cancel
Showing results for 
Search instead for 
Did you mean: 

Report not refreshing when using .NET runtime

Former Member
0 Kudos

Hi all,

we are using Crystal Reports XI to build reports on Frontrange ITSM data in a sqlserver database.. and using the CR XI .NET Runtime to view the reports embedded in the ITSM application.

Now, if I run a report, then modify the record in the application and run the report again, it is not showing the updated data - that's with the .NET thing

But if I run the report in CR XI Designer, update the record in the app and run the report again in the designer, it does refresh..

Thanks for any help/insight !

Antoine

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Antoine,

Are you changing the schema of the report at runtime? If yes then it is not possible without using RAS sdk available using CRXI Developer edition of Crystal reports product. For any change made in the report structure or database schema you need to open the reports in designer, update the fields, save it and then use it in application.

To pass parameter at runtime you can use the SetParameterValue() method in .net so that you can pass parameter to report through code. I mean if you apply this code in a button click event then everytime you want to update the parameter you can click on the button rather than hitting the refresh button of viewer control.

If you want you can have a look at the samples [here|https://boc.sdn.sap.com/node/7770].

Does that help?

AG.

Former Member
0 Kudos

Thanks AG, but, sadly, I am not coding, I don't have access to the code here. The situation described is with Frontrange ITSM 5074 and the .NET Runtime of Crystal Reports XI.. What I am looking for is some parameter(s) in the report or in a config file somewhere, that would force the .NET Runtime to behave like the Developer version does, ie, refresh data..

cheers,

Antoine

Former Member
0 Kudos

HI Antoine,

As far as my knowledge goes, web.config file do not have any options to send parameter to the page that is calling the report and viewing the report, it is generally passed from that page itself from asp or code behind page. However we can try putting a globalized function in the config page so that it can get execute but we need to call it up otherwise it will be just like a one time hit thing. I mean it will executed just once. (At least I have never tried that or know if that could be done. However I am going to give it a shot but that might take time, in the meantime lets see if someone else has got some idea about it. Sorry!)

The only option that I can see for this is to use the viewer's refresh button to call the reports default properties, which will bring in the parameter page so that we can pass the new parameters to the report. Hitting the browser's refresh button may not work as it might just let the viewer pull the same data if the code is not written in Page_Load/Init event, which we may not know as we do not have access to that...

Hope that keeps you going for some time till we hear something else...

Regards,

AG.

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks to all,

as I said, I am not coding.. I'm using Frontrang ITSM and the CR XI .NET runtime integration, and wanted to either:

- find out if I could change the Runtime's behaviour via a config file somewhere

- or come to the conclusion that ITSM's code must be amended bu the vendor

I think I have understood the the second option is the only one, and I have advised the vendor who will fix his code.

cheers,

Antoine

thomas_johnson
Explorer
0 Kudos

I found if at design time you are saving data, that the same data is displayed at runtime if you use the same parameters. As soon as I use a different parameter at runtime, the new data populates and I can go back and then select thr original parameter I wanted from the start which happened to be the same as what I was using at design time. I found a workaround (without turning off savedata which saves me a lot of time at design time).

At the beginning of your Page Load event add:

If Not Page.IsPostBack Then

.ReportDocument.Refresh() End If ' Now set parameters here... Where is the name of your Crystal Report Source Object. This needs to be done before you set your parameters. My example is:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not Page.IsPostBack Then

CRSServiceAlertsReport.ReportDocument.Refresh()

End If

CRSServiceAlertsReport.ReportDocument.SetParameterValue("Customer", Session("theCustomer"))

CRSServiceAlertsReport.ReportDocument.SetParameterValue("InternalSite", True)

End Sub

This allows you to use saved data at design time and gets around the issue if the user uses the same parameter at runtime.

Good Luck,

TJ

Former Member
0 Kudos

Thanks Thomas,

problem is that I just can't do all this since I don't have access to the source code.. I can only forward everything to the vendor.

cheers,

Antoine

former_member183750
Active Contributor
0 Kudos

Why don't you get the vendor to communicate with us? It's their app, therefore it's their problem.

Ludek

thomas_johnson
Explorer
0 Kudos

I just found out my solutions works for the displayed data. But it you have PrintMode='ActiveX' and click the print, I get the saved data not the refreshed data! What is up with that!

I changed all my PrintModes becasue with CR2008 you now have to click "Open" to print and with CR2005 Basic my users didn't and they complained about the necessity to make another click. I've been wokring with Print/Export issues and now old data in the reports ever since upgrading.

Former Member
0 Kudos

You can call verifydatabase then set the parameter and call the reportsource of the viewer and assign the report instance

cheers

Former Member
0 Kudos

What if you call

VerifyDatabase()

method of the ReportDocument before setting the paramater's value, what happens?

Cheers

Former Member
0 Kudos

Thanks for your input Alphonse, but can I do this without having access to the soure of the caller or the viewer ?

Former Member
0 Kudos

Looks like the report comes from the cache. I am not sure how to clear the cache for a particular report but in order to confirm may be you can try running the report with a different set of input params after the data modifications. If this fetches the updated data then the case is a confirmed cache report.

Elan.

Former Member
0 Kudos

Thanks for your answer Elan

Yes, if I change parameters, the report does refresh..

This is actually the workaround we are using for now, we hit the refresh button, the system asks for credentials, and the it refreshes without changing the report's parameters.

Former Member
0 Kudos

but.. this caching is wrong.. I'd like to get rid of that behaviour.. how can I do this ???