PDA

View Full Version : سوال: خطای ارتباط با جدول در stimulsoft



arman174
یک شنبه 16 آبان 1395, 23:07 عصر
با سلام
ببخشید می خواستم از اساتید بپرسم این خطا و نوع نوشتن کد را می شود تصحیح بفرمائید لطفا چون همه اش خط variables را خطا می دهد .
البته در داخل گزارشمم همه چیز را تعریف کرده ام .
لازم بذکر است در صورت نیاز فایل ساخته شده را نیز ضمیمه کرده ام
protected void Button1_Click(object sender, EventArgs e)
{



//بخش نتظیم کانکشن توسط webconfig
string strconstring;
strconstring = ConfigurationSettings.AppSettings["constring"];






string da = HttpContext.Current.Server.MapPath(string.Empty);
Stimulsoft.Report.StiReport a = new StiReport();
//معرفی گزارش آماده
a.Load(da + "\\print\\print.mrt");
//تغییر کانکشن stimul
a.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Con", constring));
//ارسال پارامتر به stimul
a.Dictionary.Variables["codesaham"].Value = TextBox1.Text;
//نمایش توسط web viewer
StiWebViewer1.Report = a;
}


public string constring { get; set; }
}

143384143385

fakhravari
دوشنبه 17 آبان 1395, 10:17 صبح
ادرسی دهی با server.mappath باشد.


StiReport MyReport = new StiReport(); MyReport.Load(Server.MapPath(@"~/Reporting/All_Topik.mrt"));
Stimulsoft.Report.Dictionary.StiSqlDatabase sti = new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", DAL.ConnectionString);
MyReport.Dictionary.Databases[0] = sti;
StiWebViewer1.Report = MyReport;
StiWebViewer1.DataBind();

arman174
دوشنبه 17 آبان 1395, 16:21 عصر
ادرسی دهی با server.mappath باشد.


StiReport MyReport = new StiReport(); MyReport.Load(Server.MapPath(@"~/Reporting/All_Topik.mrt"));
Stimulsoft.Report.Dictionary.StiSqlDatabase sti = new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", DAL.ConnectionString);
MyReport.Dictionary.Databases[0] = sti;
StiWebViewer1.Report = MyReport;
StiWebViewer1.DataBind();

ممنون ازلطف شما
میشه توضیح بیشتری بدهید؟
بعد استاد ببخشید اون variable در کجا قرار میگیره؟
خیلی گیرم اگه لطف کنید ممنون میشم
اگه براتون مقدوره کد خودمو تصحیح کنید ممنون میشم

fakhravari
پنج شنبه 20 آبان 1395, 14:31 عصر
ببنید شما دارید مستقیم با دیتابیس query میزنید.
یعنی از سمت کد conection درست میکنید و به ایتیمول میدین.
در این نمونه کد پاین طریقه ست کردن کانکشن استریگ است
http://www.codeproject.com/Questions/1118322/How-can-I-set-connection-string-of-a-stimulsoft-re

http://www.codeproject.com/Questions/851134/How-can-I-change-connection-string-of-a-stimulsoft