R
Rich
On my development machine where I have Visual Studio 2005 loaded, I have an
app that uses the Report control. I can view data in report format with the
Report control -- the data renders OK in the Report control. My problem is
in rendering the report from the rdlc file for printing to a line printer.
Following the example from MSDN Help at
http://msdn2.microsoft.com/en-us/library/ms252172(VS.80).aspx
I can print the rdlc report file to the line printer from my development
machine. But I deployed the same app app to a User's machine (using Click
once), and the print job failed at
report.Render("Image", deviceInfo, CreateStream, out warnings);
Does anyone have any idea what file/reference/library I need to include in
the deploy without having to load VS2005 on the user machine? Note: I am
already including the refence to Microsoft.ReportViewer.Common and
Microsoft.ReportViewer.Winforms, and I already copy the entire content of the
Report rdlc file
Here is the area where the print job is failing (--the entire code for the
print routine is at
http://msdn2.microsoft.com/en-us/library/ms252172(VS.80).aspx--)
private Stream CreateStream(string name, string fileNameExtension,
Encoding encoding, string mimeType, bool willSeek)
{
Stream stream = new FileStream(name + "." + fileNameExtension,
FileMode.Create);
m_streams.Add(stream);
return stream;
}
private void Export(LocalReport report)
{
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.25in</MarginTop>" +
" <MarginLeft>0.25in</MarginLeft>" +
" <MarginRight>0.25in</MarginRight>" +
" <MarginBottom>0.25in</MarginBottom>" +
"</DeviceInfo>";
Warning[] warnings;
m_streams = new List<Stream>();
report.Render("Image", deviceInfo, CreateStream, out warnings); <<<---fails
here
foreach (Stream stream in m_streams)
stream.Position = 0;
}
app that uses the Report control. I can view data in report format with the
Report control -- the data renders OK in the Report control. My problem is
in rendering the report from the rdlc file for printing to a line printer.
Following the example from MSDN Help at
http://msdn2.microsoft.com/en-us/library/ms252172(VS.80).aspx
I can print the rdlc report file to the line printer from my development
machine. But I deployed the same app app to a User's machine (using Click
once), and the print job failed at
report.Render("Image", deviceInfo, CreateStream, out warnings);
Does anyone have any idea what file/reference/library I need to include in
the deploy without having to load VS2005 on the user machine? Note: I am
already including the refence to Microsoft.ReportViewer.Common and
Microsoft.ReportViewer.Winforms, and I already copy the entire content of the
Report rdlc file
Here is the area where the print job is failing (--the entire code for the
print routine is at
http://msdn2.microsoft.com/en-us/library/ms252172(VS.80).aspx--)
private Stream CreateStream(string name, string fileNameExtension,
Encoding encoding, string mimeType, bool willSeek)
{
Stream stream = new FileStream(name + "." + fileNameExtension,
FileMode.Create);
m_streams.Add(stream);
return stream;
}
private void Export(LocalReport report)
{
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.25in</MarginTop>" +
" <MarginLeft>0.25in</MarginLeft>" +
" <MarginRight>0.25in</MarginRight>" +
" <MarginBottom>0.25in</MarginBottom>" +
"</DeviceInfo>";
Warning[] warnings;
m_streams = new List<Stream>();
report.Render("Image", deviceInfo, CreateStream, out warnings); <<<---fails
here
foreach (Stream stream in m_streams)
stream.Position = 0;
}