without loading VS2005 on user machine how to make app work? Dev

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UmljaA==?=

    without loading VS2005 on user machine how to make app work? Dev

    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



    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.Repor tViewer.Common and
    Microsoft.Repor tViewer.Winform s, 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/lib...(VS.80).aspx--)

    private Stream CreateStream(st ring name, string fileNameExtensi on,
    Encoding encoding, string mimeType, bool willSeek)
    {
    Stream stream = new FileStream(name + "." + fileNameExtensi on,
    FileMode.Create );
    m_streams.Add(s tream);
    return stream;
    }

    private void Export(LocalRep ort report)
    {
    string deviceInfo =
    "<DeviceInf o>" +
    " <OutputFormat>E MF</OutputFormat>" +
    " <PageWidth>8.5i n</PageWidth>" +
    " <PageHeight>11i n</PageHeight>" +
    " <MarginTop>0.25 in</MarginTop>" +
    " <MarginLeft>0.2 5in</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;
    }


  • =?Utf-8?B?UmljaA==?=

    #2
    RE: without loading VS2005 on user machine how to make app work? Dev

    I observed that I my own development machine, I have the same printing
    problem from the deployed application, but if I invoke the exe from
    ..../bin/debug/myapp.exe
    then the print works OK. So obviously something is not getting deployed. I
    need to include something in the Prerequisites ... but what?


    "Rich" wrote:
    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
    >

    >
    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.Repor tViewer.Common and
    Microsoft.Repor tViewer.Winform s, 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/lib...(VS.80).aspx--)
    >
    private Stream CreateStream(st ring name, string fileNameExtensi on,
    Encoding encoding, string mimeType, bool willSeek)
    {
    Stream stream = new FileStream(name + "." + fileNameExtensi on,
    FileMode.Create );
    m_streams.Add(s tream);
    return stream;
    }
    >
    private void Export(LocalRep ort report)
    {
    string deviceInfo =
    "<DeviceInf o>" +
    " <OutputFormat>E MF</OutputFormat>" +
    " <PageWidth>8.5i n</PageWidth>" +
    " <PageHeight>11i n</PageHeight>" +
    " <MarginTop>0.25 in</MarginTop>" +
    " <MarginLeft>0.2 5in</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;
    }
    >
    >

    Comment

    • =?Utf-8?B?UmljaA==?=

      #3
      solution to Report.Render problem - changed rdlc path reference

      I found the problem and post the solution - for future reference.

      The problem was with the report rendering. It turns out that in the
      development environment I was referencing the rdlc file in one location on
      the dev machine which was not in the bin folder, but on deployment the rdlc
      file was deploying with the .exe to a subfolder in the
      application.sta rtupPath. So I changed my path reference to
      application.sta rtupPath\subfol der and now the operation works correctly
      after deployment.



      "Rich" wrote:
      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
      >

      >
      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.Repor tViewer.Common and
      Microsoft.Repor tViewer.Winform s, 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/lib...(VS.80).aspx--)
      >
      private Stream CreateStream(st ring name, string fileNameExtensi on,
      Encoding encoding, string mimeType, bool willSeek)
      {
      Stream stream = new FileStream(name + "." + fileNameExtensi on,
      FileMode.Create );
      m_streams.Add(s tream);
      return stream;
      }
      >
      private void Export(LocalRep ort report)
      {
      string deviceInfo =
      "<DeviceInf o>" +
      " <OutputFormat>E MF</OutputFormat>" +
      " <PageWidth>8.5i n</PageWidth>" +
      " <PageHeight>11i n</PageHeight>" +
      " <MarginTop>0.25 in</MarginTop>" +
      " <MarginLeft>0.2 5in</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;
      }
      >
      >

      Comment

      Working...