RS SP2 Client Side printing programatically (through SOAP API /RSClientprint.dll) !!! ???

  • well i got my RS Sp2 copy today n i ve installed it but frankly i dont

    know how to print the report directly through my web application. if

    some one could plz direct me to any web source / source code for

    printing reports through SOAP API (programatically) i ll b thankful.

    i ve seen rsclientprint.dll but couldnt understand how to use it

  • This was removed by the editor as SPAM

  • go here http://www.csharphelp.com/archives3/archive545.html and download the source code. Its fairly self explainatory and will get you up and running quickly.

    I am having issues myself. While the code is straightforward and does indeed work, I am having issues with the report data actually expanding (looks like a font size issue) when rendered from some machines. I have been unable to figure out why. You may have better luck .

     

     

  • well buddy thanks for ur concern but i m sorry if i could not make it clear

    actually i want to use the rsclientprint.dll library shipped with reporting service sp2 that enables us print reports on the client side using the PRINT method of the rsclientprint class but i m not getting it done properly so plz if u ve any clue regarding this i ll b gratefull i need some sample code / web reference or any simple example developed by u that uses rsclientprint.dll for printing reports

    thanx

    regards

  • I've been experimenting with this with no luck Muhammad.  I added a reference to the type library RSClientPrint.tlb.  I instantiated the RSClientPrintClass class.  I set to Culture and UICulture to System.Globalization.CultureInfo.CurrentCulture.LCID and System.Globalization.CultureInfo.CurrentUICulture.LCID respectively.  I set Page width and height, as well as margins to normal values.  I didn't know what the Authenticate property was for so I didn't fill it in...  I called Print with the following parameters:

    reportServerUrl: "myserver/ReportServer" where myserver was my server name

    reportPath: "/Evaluation Reports/Defect Detail Report" (this is the path to your report)

    reportName: "Defect Detail Report"

    I filled in these parameters based on almost nonexistent examples in the sp2 readme (in fact, much of the information there is very inaccurate, let alone missing.)

    The server request just hangs on the call to print, so apparently I'm doing something wrong still.  I take it you're developing a custom toolbar or some other integration into your web app as well?

    We have a couple of MSDN support calls left.  I have a feeling I'm using one for this.  If I do, I will respond when I have an answer.  Please do the same for me

  • Okay, here is the solution.  Forget all about the type library RSClientPrint.tlb.  That's for windows apps, not web apps.  In your web app, when your user clicks the print button, add this client side code to the page:

    <OBJECT ID="RSClientPrint" CLASSID="CLSID:FA91DF8D-53AB-455D-AB20-F2F023E498D3" CODEBASE="?rs:Command=Get&rc:GetImage=8.00.1038.00rsclientprint.cab#Version=2000,080,1038,000" VIEWASTEXT></OBJECT>

    <script language="javascript">

    function PrintReport()

    {

    var RSClientPrint = document.getElementById('RSClientPrint');

    RSClientPrint.MarginLeft = 25.4;

    RSClientPrint.MarginTop = 25.4;

    RSClientPrint.MarginRight = 25.4;

    RSClientPrint.MarginBottom = 25.4;

    RSClientPrint.PageHeight = 279.4;

    RSClientPrint.PageWidth = 215.9;

    RSClientPrint.Culture = 1033;

    RSClientPrint.UICulture = 9;

    RSClientPrint.Print("http://myserver/ReportServer", "%2fEvaluation+Reports%2fDefect+Detail+Report&EmployeeID=16&LanguageID=en-US", "Defect Detail Report")

    }

    setTimeout('PrintReport()', 1);

    </script>

     

    Margins and Page size are self explanatory.  Culture and UI Culture I explained in my last post.

    As for the print RSClientPrint.Print function, the first argument is obviously the report server url. 

    The second argument is the encoded path to your report PLUS parameters.  For my example, my report is located in a folder called Evaluation Reports.  The report is called Defect Detail Report.  It has 2 parameters, EmployeeID with a value of 16 and LanguageID with a value of en-US.  To get the encoded version of your string, just call Server.UrlEncode on it.  e.g. for me I called Server.UrlEncode("/Evaluation Reports/Defect Detail Report&EmployeeID=16&LanguageID=en-US")

    The third argument is the title of the report, in my case Defect Detail Report.

    I hope this helps.  If you have any specific questions, I will be happy to help.  My post was a lot longer, but it disappeared when I tried to post it

     

  • Hi there.

    How about printing from a vb.net windows app?

    I have my web reference set, but nowhere can I find the reporting services Print function. Does it appear in the list with the Render command?

    Any help appreciated.

    Cheers,

    Pete.

  • Peter -

    You have to add the RSClientPrint.tlb type library to your normal References list.  Then instantiate the RSClientPrintClass class, set its properties, and call the Print() function.  I haven't tried this yet - but it seems straight forward.

     

    Jeremy

  • Thanks for the quick reply Jeremy.

    I've got the RSClientPrint.dll referenced in my project, and set up the Print() function (using: Dim rsPrinter As New RSClientPrintLib.RSClientPrint), but now I'm getting the following error when running the Print():

    Print Error

    -------------------------------------

    Error loading resource library (0x80004002)

    No such interface supported.

    The criteria I'm using is as follows:

    url = http://localhost/ReportServer

    path = /ML Environment/Marlborough Lines Reports/ML Workpack&WorkPackNo=819

    name = ML Workpack

    Any ideas?

    Thanks,

    Peter.

  • Hi Peter -

    I've looked on the MS Reporting Services newsgroups and it looks like many people are receiving that error.  One of the causes is if you were a beta tester for RS SP2, you will have two versions of the library installed with the same GUID.  Some other people, however, are getting this error even though they were not beta testers.  It looks like they're still looking into that one.  Hop on the RS newsgroup and check out those topics.  You can find them on microsoft's website if you don't have a news reader.)  Run a search in the group for RSClientPrint and you will get many results.

    I'd like to try this out for myself, but unfortunately I can only do so at work and this week is very hectic.  I will try to reply by Tuesday the 21st.  If I don't, post back here so I get an email notification because I may have forgotten

    If you figure it out before then, please reply here with the solution as I am interested as well.

    [Edit] P.S. your parameters look perfect, so that is not the problem. [/Edit]

    Jeremy Rosenberg

  • Thanks again Jeremy.

    I'll have a bit of a look into it and see what I can find out. If I get anywhere I'll let you know.

    Cheers, Pete.

  • hi Jeremy

    I've Used your code for web app and it's working great

    But now i have other P:

    when the user click the dialog box of the printer  is Shown.

    I want to print 10 differnt reports with one click.

    Is there a way that the printer dialog box won't open ???

  • http://www.csharphelp.com/archives3/archive545.html 

    This code prints SERVER side not CLIENT side as requested. 

    Has any one got a client side solution using SOAP? 

    The code posted by Jeremy also assumes that the user can directly see the 'Report Server' so is cannot be considered as a option for ppl using the SOAP API.  As the SOAP API is often used because you do not want to expose your report server to the whole wide world.

    Thanks

  • mr_miller:

    At first when I read this, I started trying to look more stuff up.  But as I keep reading it, it makes less sense to me.  How can you print client side using SOAP API?  The web service takes client requests and sends server responses, so it can send things like report data and properties, server properties, etc. but it cannot tell your client to print or redirect your client to a page with client side print code.  This is exactly the reason Microsoft made the client side print functionality into an ActiveX control - because the server (and even your web browser), doesn't have access to your desired printer driver at the time of rendering, and therefore can't do things like paginate in the right places, or set margins, etc.  You can request the rendered output for a particular extension from the server.  Does that make sense?

    To your point about Report Server being exposed - it's not.  We have a web server and a data server where I work for our application.  SQL Server 2000 and SQL Reporting Services on the data server, IIS on both.  The virtual directories for Reports and ReportServer will be on the data server.  The data server can only be seen by the web server, and the web server is the only one making direct requests to the Report Server.

    Furthermore, if you're making SOAP requests from a client, your Report Server must be exposed anyway as that is where the web service is stored, right?

    Jer

     

  • You will probably have to wait until November when Reporting Services 2005 ships with client side printing. 

    In the mean time, both of these will work:

    http://www.csharphelp.com/archives3/archive545.html

    http://blogs.msdn.com/bryanke/articles/category/3529.aspx

    I hope this is of some help to you.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic. Login to reply