Posts tagged Crystal Server 2008

urlreporting1

How to Launch Crystal Server Reports Via URL and Include Parameters

So You have a report in your Crystal Server that you want to share or include in another site, well, im going to teach you how to use the OpenDoc URL to run the report.
Here is how it works

Let’s say you have a report called Invoices.rpt located in the “Asset Management” Folder

The report has a main report and a sub report.  The report takes 2 paramenters, PONumber for the main report, and CheckNUM for the subreport

 

You Only really need a few parameters, and they are:

  • iDocID
  • lsS”ParameterName”
  • promptOnRefresh

 

NOTE: I’m assuming that your crystal viewer is “Single Sign On”, we don’t need to or care to pass a user name and password, if it is not, your user will get prompted for his credentials.  I suggest you work on getting SSO working, as this makes the process quick and painless

 

How to get the Report ID

 

In order to get the report ID, right click the report and select properties

 

 

The ID is shown under the Report Title (this is the same as iDocID)

 

 

Now we need to get the Parameters that the report is prompting for

 

How to get the Report Parameters

 

Right Click on the Report, and Select View

 

It will take you to the report viewer, at which point it will prompt you for the parameters it needs

 

 

Note the names that it is prompting for.  The main report is prompting for “PoNumber” While the Subreport is prompting for “CheckNUM” (and the reason that we know it is a sub-report is because it is wrapped around in parenthesis)
Now that we know what parameters we need, is time to build our URL

 

How To build the Report URL

 

All report URLS will begin with http://mycrystalserverurl/OpenDocument/opendoc/openDocument.aspx?

 

If we visit this url, you will see that Crystal gives an error that says

obviously we need to let the viewer know which report to load, so that’s what the ID is for, so now if we go to  http://mycrystalserverurl/OpenDocument/opendoc/openDocument.aspx?idocid=9767 (9767 being the ID we gathered before)

 

We now get the same parameter prompt that we had above, but the Goal here is to automatically pass the parameters to the report, so that’s where the “lsS” variable comes in to play

 

By adding the parameter in the form of lsSPARAMETERNAME, we now see that the report only prompts for the parameter in the sub report http://mycrystalserverurl/OpenDocument/opendoc/openDocument.aspx?idocid=9767&lsSPONumber=2150

 

But simply adding lsSPARAMETERNAME  wont target the parameter in the sub-report.  In order to do that, you need to add something to the lsS variable.  It needs to be in the form of lsSPARAMETERNAME@SUBREPORTNAME.  Notice the “@” symbol, it is important to include it along with the name of the sub-report, otherwise crystal won’t know where to set the variable

 

So now, we have our complete URL that looks like this:

http://mycrystalserverurl/OpenDocument/opendoc/openDocument.aspx?idocid=9767&lsSPONumber=2150&lsSCheckNUM@checkSummary=5560

 

Notice that the name of the sub-report in the lsS variable must match whatever the name was in the parenthesis.  So now we have a url that once clicked, it will take you to the report viewer ready to view the report

 

But wait, what about promptOnRefresh, ah yes, well, that parameter is pretty self explanatory, but I will explain it anyway.  When you created your report, you made it to prompt you for the parameters which we pre-filled with the lsSVariableName, but If your user clicks on the refresh button, they will be prompted for the parameters again.  If you set promptOnRefresh to “0”, then even if the user hits the refresh button, they will not get prompted again for the parameters.  The report will always continue to use the original parameters that were passed to it in the URL.

Here is a sample URL with promptOnRefresh:
http://mycrystalserverurl/OpenDocument/opendoc/openDocument.aspx?idocid=9767&lsSPONumber=2150&lsSCheckNUM@checkSummary=5560&promptOnRefresh=0

 

That’s all, now you are a Crystal Server URL reporting expert 🙂

Facebook Twitter Email Linkedin Digg Delicious
appPool

How to Create an Application Pool in IIS7 (CrystalServer2008)

Recently a Pinchii reader 🙂 sent me a message asking how I created the “CrystalServer2008” Application Pool as part of the solution in the post titled “Error 80040154 when using .Net Infoview”

What I had not realized is that I never posted the Instructions on how to Install Crystal Server on 2008 which I had promised, and hence, the Instructions on how to create the Application Pool were also never posted. Well, here is how to Create the “CrystalServer2008” Application Pool:

  • Open Up Internet Information Services (IIS) Manager
  • Expand the Entry for your server, it looks like [ServerName (Domain\User)]
  • There are two items there, 1 is “Application Pools” and the Other is “Sites”
  • Right Click on Application Pools and Select “Add Application Pool”
  • When the Wizard comes up, give it a Name, in this Case “CrystalReports2008”
    (the reason I give it that name, is so I know what the Application Pool is for,
    and normally I name the Application Pool Similar to the Site that hosts the Application)
  • Change Managed Pipeline to Classic
  • Now Right Click the Newly Created AppPool and Select “Advanced Settings”
  • Change “Enable 21-Bit Application” to True
  • This last step is not necessary, but I did it because I setup Kerberos Single Sign On, Change the Identity from Network, to a Domain Service Account
  • Restart the Application Pool
  • Done

Here is a Screen shot of what my Application Pool Looks like

Facebook Twitter Email Linkedin Digg Delicious
Go to Top