سؤال

هل من الممكن تغيير سلسلة الاتصال لتقرير خدمات تقارير SQL المنشور؟أستطيع رؤية الحقل الثنائي المسمى DataSource في قاعدة بيانات ReportServer، ولكن بما أنه تم تخزينه كثنائي فلا أعتقد أنه قابل للتحديث بسهولة.

هل أحتاج إلى إعادة نشر التقرير بمصدر البيانات الصحيح؟آمل ألا يحدث ذلك لأنني لا أريد تثبيت VS2003.

يحرر:يقوم العميل بتشغيل SQL Server 2000 Reporting Services مع تثبيت كافة حزم الخدمة.

هل كانت مفيدة؟

المحلول

تحتوي SQL Reporting Services 2000 على [خدمة ويب](http://msdn.microsoft.com/en-us/library/aa274396(SQL.80).aspx) التي يمكنك استخدامها لتغيير مصدر البيانات.ونظرًا لذلك، فإن ما يلي يسمح بتغيير مصدر البيانات إلى مصدر بيانات مشترك.كان هذا [مقتبس من MSDN](http://msdn.microsoft.com/en-us/library/aa225896(SQL.80).aspx).

// Create our reporting services class
ReportingService theRS = new ReportingService();
theRS.Credentials = System.Net.CredentialCache.DefaultCredentials;

// We need to setup a data source reference to an existing shared data source
DataSourceReference theDSRef = new DataSourceReference();
theDSRef.Reference = "/Path/To/ExistingSharedDataSource";
DataSource[] theDSArray = new DataSource[1];
DataSource theDS = new DataSource();
theDS.Item = (DataSourceReference)theDSRef;
theDS.Name = "NameOfSharedDataSource";
theDSArray[0] = theDS;

try
{
    // Attempt to change the data source of the report
    theRS.SetReportDataSources("/Path/To/ReportName", theDSArray);
    Console.Out.WriteLine("We have changed the data source");
}
catch (System.Web.Services.Protocols.SoapException e)
{
    Console.Out.WriteLine(e.Message);
    Console.Out.WriteLine(e.Detail.InnerXml.ToString());
}

في هذا المثال، خدمة التقارير يتم أخذ الفئة من فئة الوكيل التي قمت بإنشائها للتحدث إلى خدمة الويب، والتي تم وصفها [هنا](http://msdn.microsoft.com/en-us/library/aa256607(SQL.80).aspx).

آمل أن يساعد هذا البعض.اسمحوا لي أن أعرف إذا كنت تبحث عن شيء مختلف.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top