sql server reporting services:
Hello all I'm having an unusual problem, although I'm used to Server based reports so maybe it's a newbie thing. When trying to view a local report on a client PC, I'm doing this: reportViewer.LocalReport.ReportPath = @"MyReport.rdl"; reportViewer.LocalReport.DataSources.Add(new ReportDataSource("dataSetName", new MyDataSource(connectionString))); reportViewer.SetDisplayMode(DisplayMode.PrintLayout); reportViewer.RefreshReport(); "reportViewer" is a WinForms.ReportViewer "MyDataSource" derives from DataTable Works fine on my Dev machine, in Debug or Standalone. But on other machines (having ran ReportViewer.exe redistributable AND copied MS.RV.Common.Dll/MS.RV.WinForms.Dll into the folder) the whole app actually crashes out with a "you have encountered a problem...send to Microsoft...etc". It crashes on the ReportRefresh() command. What is unusual is that there is no exceptions thrown. So I'm just not sure how to go about debugging this. Any ideas? Is it something to do with .rdc files? Thanks -- M.
Okay, I feel stupid replying to my own post but I solved it. And it's STILL weird. I went from this (where ShowViewer() is called by the Constructor of the Windows Form) : private void ShowViewer() { reportViewer.RefreshReport() this.ShowDialog(); } To this: private void ShowViewer() { this.ShowDialog(); } private void ViewForm_Shown(object sender, EventArgs e) { reportViewer.RefreshReport() } Which is fine...I have no problem with this fix. The containing control must be instantiated before refreshing the report blah blah blah. HOWEVER, it doesn't explain how this works in my Dev machine outside the debugger. Any views? -- M. MCDBA : MCSD
Don't see what you're looking for? Try a search.
|