Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
icw
Constraint Violating Yak Guru
378 Posts |
Posted - 2009-05-26 : 00:15:53
|
I have had someone create a bit of custom code for me so That i can send my report as an email attachment.Now everytime I try to use the Preview screen in BIDS I get an error telling me that "Reportviewer1 is not declared"Can anyone help please <Code>Public Function ExportReport() As String Dim streamids As String() Dim mimeType As String Dim encoding As String Dim filenameExtension As String 'Render the report to a byte array Dim bytes As Byte() If reportViewer1.ProcessingMode = ProcessingMode.Local Then bytes = reportViewer1.LocalReport.Render("PDF", Nothing, mimeType, encoding, filenameExtension, streamids) Else bytes = reportViewer1.ServerReport.Render("PDF", Nothing, mimeType, encoding, filenameExtension, streamids) End If 'Write report out to temporary PDF file Dim filename As String = Path.Combine(Path.GetTempPath(), "ReportToAttach.pdf") Using fs As New FileStream(filename, FileMode.Create) fs.Write(bytes, 0, bytes.Length) End Using 'return path to saved file Return filename End Function </Code> |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-26 : 12:38:38
|
where have you declared reportViewer1? |
|
|
icw
Constraint Violating Yak Guru
378 Posts |
Posted - 2009-05-26 : 14:06:57
|
It doesn't look like it is declared anywhere. Problem is I am not a developer I don't know how to do it and I can't get hold of the guy who did this for me.I know i can't ask you to do this but if anyone can take a look at the attached rdl file and give me a clue where and how to declare the reportviewer.I should point out i'm running the reports through IE (don't know if that makes any difference)[url]http://www.iwicks.com/SingleCallDrillDown.zip[/url]I really do appreciate it if someone can help me out here |
|
|
|
|
|
|
|