|
-
Jun 19th, 2003, 02:05 PM
#1
Thread Starter
Lively Member
Please help...Report not refreshing properly
I have a VB form through which I pass parameters and execute the Stored Procedure. This will then update the fields in TTX file . I have invoked a report based on this TTX file.
I used the same code to invoke another report which is refreshing report (based on the TTX file) properly.Whereas ,there is this other report which uses a similar piece of code and,rather updates the contents of the TTX file properly ; but it does not display the refreshed data ;unless I unload the VB application and restart it ;whereby it shows the updated TTX file.
Also,on clicking the "Refresh" button on the CR Viewer from the VB Call does not help at all ;although if I am open the report using the Report Designer tool and use Refresh button from within,report works fine.
( I referred to quiet a few posts and found out that "Save data with report" should be unchecked and, CRXReprt.DiscardSavedData should discard prev. data ; but both of them don't seem to be working on this particular report. )
These are my observations related to the report which is not working properly :
There is this piece of code which displays different results in 2 scenarios :
VB Code:
Set ADORset = ADOCmd.Execute
Debug.Print "State of ADORset : " & ADORset.State
Scenario 1: Working report
-------------------------------------
Case a) On running the application and passing the default parameters for the 1st time, report displays proper data as the ADORset.State sets to 1 .
Case b) Without unloading the application , and trying to pass different parameters for the report ADORset.State set to 1 and report displays proper result.
Scenario 2: Not Properly Working report
----------------------------------------------------
Case a) On running the application and passing the default parameters for the 1st time, report displays proper data(in this case,no data) as the ADORset.State sets to 0 .
Case b) Without unloading the application , and trying to pass different parameters for the report whereby ADORset.State is set to 1,report does not display proper result.
Case c) Although , if I unload the application and then re-load it and then ,pass the same parameters as in Case (b) , the report shows proper data.
Case d) Applied Case ( 2 a ) , followed by Case ( 1 a) ,followed by Case ( 2 b ) reflects proper output for the 2nd report.
I referred to a post at Crystal Decisions : http://support.crystaldecisions.com/forums/message.asp?fid=78&sk=32&ps=25&pn=1&mid=5095 wherein it is suggested :
I usually create SQL stored procedures for my Crystal Reports. I add an extra parameter which I call RequestTime varchar(6). The stored procedure doesn't use this value. When I call the report on the web, I set the current time in the format "HHMMSS" to this parameter. This forces the report to always refresh. (Report is also set not to save data)
but I could not exactly follow how this can be achieved.
'coz the report which is working properly has a Datetime field defined in the SP and is one of the parameters. But,the other report has no datetime field as the parameter.And,I am not sure what steps he is trying to suggest above.
-
Jun 19th, 2003, 10:24 PM
#2
Hyperactive Member
If you are using CR9 with TTX files, there is an issue on updating the TTX file ( i don't know if this is related to your problem).
I read this somewhere at CR's support website but I did not bookmark the link coz I don't use TTX files. Sorry I can't pinpoint you to the article I mentioned but you can try by checking it out though.
-
Jun 19th, 2003, 11:15 PM
#3
Thread Starter
Lively Member
Thank you ARPRINCE for guiding me .I think this :http://support.crystaldecisions.com/library/kbase/articles/c2012256.asp is the article you were talking.
Yeah,this is not of much help to me as it is in relation to CR Report Designer and not CR Viewer.
But one idea which I can come up with, reading this article is that I can possibly try to Log on and Off Server whenever I fetch a report data using VB.
Do you think this is possible and can you offer any incite ?
Thanks a ton.
-
Jun 20th, 2003, 09:59 AM
#4
Hyperactive Member
It sould be possible but I never tried it. You can try:
VB Code:
crxReport.Database.LogOnServer (enter parameters here)
crxReport.Database.LogOffServer (enter parameters here)
-
Jun 20th, 2003, 12:48 PM
#5
Thread Starter
Lively Member
Thank you ARPRINCE. You are absolutely correct .This option,namely : crxReport.Database.LogOnServer (enter parameters here) is available ; but the issue here is that in my case, since I am using a TTX File , if I check my "Set DataSource Location" from CR,it is not of the form "Server_name,dsn,userId,Password" ;but rather a direct path to TTX and I do not have to enter any Connection String to view the report ; So,I am not sure what the parameters would look like in this scenario.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|