Reuse Crystal report Viewer For different reports - unload cache

So I am migrating from crystal reports basic to crystal reports 2008. I have hit a stumbling block. Rather than have a new page and report viewer for each report I decided it would be easier to have one report viewer and send to it in session variables the report I wish to run and appropriate parameters. This seemed to work fine in CR basic.
Now I have upgraded the viewer works fine for the first report I run however it then caches this report and doesn't seem to clear it down, if the new report has different parameters I will get a parameter error. If I run a report requiring the same parameters I will get the original report not an updated one.
I believe I need to leave the CrystalReportSource cache on in order to page the report (correct me if I am wrong)
I have taken a few snippets of code, is this possibly running too late in page life cycle have I missed something or is there a way to force a cache clear:
protected override void OnLoad(EventArgs e) {
//setup report in viewer with correct db logon
                CrystalRepSource.Report.FileName = report;
                SetupLogonInfo(CrystalRepSource);
                //add parameters
                AddParam(paramFields, pfItem1, dcItem1, "@year", year);
                AddParam(paramFields, pfItem2, dcItem2, "@school", school);
                AddParam(paramFields, pfItem3, dcItem3, "@division", division);
                AddParam(paramFields, pfItem4, dcItem4, "@progArea", progArea);
                AddParam(paramFields, pfItem5, dcItem5, "@type", SessionHandler.record_type);
                AddParam(paramFields, pfItem6, dcItem6, "@filterText", "School = \'" + school +
                                                        "\' Division = \'" + division
                                                        + "\' Programme Area = \'" + progArea
                                                        + "\' Record Type = \'" + SessionHandler.record_type_text + "\'");
CrystalViewer.ParameterFieldInfo = paramFields;
private void SetupLogonInfo(CrystalReportSource CrystalRepSource)
        TableLogOnInfo logOnInfo = new TableLogOnInfo();
        logOnInfo = CrystalRepSource.ReportDocument.Database.Tables[0].LogOnInfo;
        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo = logOnInfo.ConnectionInfo;
        connectionInfo.DatabaseName = Application["db"].ToString();
        connectionInfo.ServerName = Application["server"].ToString();
        connectionInfo.Password = Application["pass"].ToString();
        connectionInfo.UserID = Application["user"].ToString();
        CrystalRepSource.ReportDocument.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
    private void AddParam(ParameterFields paramFields, ParameterField pfItem, ParameterDiscreteValue dcItem, string fieldName, string value)
        pfItem.ParameterFieldName = fieldName;
        dcItem.Value = value;
        pfItem.CurrentValues.Add(dcItem);
        paramFields.Add(pfItem);

ok so I have tried changing the code to:
CrystalRepSource.ReportDocument.SetParameterValue("@year", year);
                CrystalRepSource.ReportDocument.SetParameterValue("@school", school);
                CrystalRepSource.ReportDocument.SetParameterValue("@division", division);
                CrystalRepSource.ReportDocument.SetParameterValue("@progArea", progArea);
                CrystalRepSource.ReportDocument.SetParameterValue("@type", SessionHandler.record_type);
                CrystalRepSource.ReportDocument.SetParameterValue("@filterText", "School = \'" + school +
                                                        "\' Division = \'" + division
                                                        + "\' Programme Area = \'" + progArea
                                                        + "\' Record Type = \'" + SessionHandler.record_type_text + "\'");
private void Page_Unload(object sender, EventArgs e)
        try
                CrystalRepSource.Report.DataSources.Clear();
                CrystalRepSource.Report.Parameters.Clear();
                //CrystalRepSource.ReportDocument.Close();
                //CrystalRepSource.ReportDocument.Dispose();
                CrystalRepSource.Dispose();
                CrystalViewer.Dispose();
                GC.Collect();
        catch { }
I experimented with various bits in the page unload as you can see I have commented a bit out at present as it was throwing an exception. The SetParametersValue while handy (will clean the code up a bit) didn't make any difference I am still getting the same issue.

Similar Messages

  • Dynamic command execution fails in Crystal report viewer for parameters

    We are using the Crystal Report Viewer for the .Net Application on the client side.The reports are designed using Crystal Report XI R2.
    The issues that we are currently encountering is that, we are unable to load the combo-boxes in the pop-up for the parameters.
    All the reports have multiple commands and the variables are of 'dynamic' type.
    When the dialog box for requesting the pop-up comes up, It comes up empty even though they are linked to the respective commands.
    Also,For reports having multiple parameters we are unable to give a single dialog box to get in all the parameters.It appears as a series of prompts.
    Both,these issues are not encountered when the reports are launched via the Crystal reports developer tool.

    Hello Varun,
    I recommend to post this questionin the [dedicated NET forum|SAP Crystal Reports, version for Visual Studio;.
    This forum is monitored by qualified technicians and you will get a faster response there.
    Thank you for your understanding,
    Falk

  • Is there a recommended crystal reports viewer for Mavericks?

    I am having some trouble finding a Crystal reports viewer for Mavericks and was wondering if someone might have some guidance as to the best solution(s).
    Thanks!

    This is the most current:
    http://scn.sap.com/docs/DOC-29774
    I don't know about Mavericks support, but it at least launches on my system.
    Regards.

  • Error while saving view for a report

    Hi All,
             I have transported queries to production and executing them from web, when I am saving the view for a report I get an error
    " The Object cannot not be processed due to a transport problem -  Notification Number RSWWW 240 "
    What could be the problem...please help
    Thanks
    Indraneel

    Check the OSS note 550760 regarding the issue.

  • How generate a crystal reports layout for Batch Report

    Dear Experts,
    I want to create a crystal reports layout for Batch Report that appears when printing Delivery Note.
    I've tried using DocKey@ token but it only works in the delivery note layout itself. The following code at the select expert for this crystal layout doesn't work:
    {ODLN.DocEntry} = {?DocKey@}
    Kindly guide me in the above issue. Thanks.

    I am using version 8.8 SP.00 PL.10
    It is very strange that I cannot get the layout connected to the database as I have followed the same steps for all layouts. It all works fine until I get to the invoice stage and then I cannot make the connection.
    (I dont need to worry about the sales invoice as this was provided at installation point by our vendor)

  • Creating Union Report using 3 different reports in OBIEE 11.1.1.5.0

    Hi Gurus,
    This is my first time where I am creating a union report, I have a urgent requirement to create a union report using 3 different reports and it has 3 common dimension columns and each report has 3 measures and a measure label, and 1st report measures has to show $ amounts with column names ,2nd report measures has to show % with column names and 3rd units with column names, the result should be in pivot with all columns and measures ,can someone please help me with steps to approach,I am really confusing with the results when i tried, I really appreciate your inputs.
    Thanks
    KP

    Addendum: I've tried it with CSV instead of XLS. Again, the repository appears to work just fine, but in Answers I get this message, similar to the Excel error:
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 16001] ODBC error state: IM006 code: 0 message: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed. [nQSError: 16001] ODBC error state: S1009 code: -1023 message: [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.. (HY000)

  • Functional report specifications for AUC reporting

    Hi All,
    Does anyone have a sample document about functional report specifications for
    AUC reporting?
    Can anyone e-mail a sample report to [email protected]
    Thank you,
    Best Regards,
    John Mc

    Hi,
    Looking at the requirement  it seems like you have 2 level of authorization check i.e. Check first user is authorized for cost center. And if yes then look for teh combination of Func area related to that cost center, for that user.
    I think keeping the second check for func. area within loop of cost center (for each cost center) should work.
    Thank-You.
    Regards,
    Vinod

  • Report definition for the report not specified

    Hello
    I have written the code  attached but getting the error "report definition for the report not specified"
    string v_report_name = Charts.ReportPermutation.ToString() + Charts.charttype + ".rdlc";
                string v_report_server = "http://MANOJ-PC/reportserver";
                string v_report_path = @"D:/Anshutech New/AnshutechPlusProjectCosting/AnshuProjMgmtSystem/AnshuProjMgmtSystem/";
                this.reportViewer1.LocalReport.ReportEmbeddedResource = "AnshuDataSet." + v_report_name;
                this.reportViewer1.ServerReport.ReportServerUrl = new System.Uri(v_report_server);
                this.reportViewer1.ServerReport.ReportPath = v_report_path + v_report_name;
                this.reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
                this.reportViewer1.RefreshReport();
    Please help
    regards
    Manoj Gokhale

    Hi kalpesh ,
    According to your description, you want to display a report which hasn’t been deployed to report server in ASP.NET MVC app, right?
    If so, you can add a ReportViewer control in ASP.NET MVC and utilize ADO.NET to provide the data to display the report. For more information, please refer to this article:
    ASP.NET MVC - Handling SSRS reports with ReportViewer – Part I.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Crystal report Viewer for 8.5 reports

    We are using an older version of Crystal reports (8.5) and use an application called RePortal (that use Crystal Enterprise) to view the reports through out the building. We recently had a report that was created and we are getting an error:
    Error encountered by Crystal PageServer
    Unable to connect: incorrect table location. File Worksheet.rpt. On Cache/Page Server:
    I tried a few solutions I found on line, but that didn't work.
    My thought was to bypass and download the free Crystal Report viewer, but the one I found was only compatible with Reports written in 9 or higher.
    Does anyone know how to resolve the error above or we I can find an older version of Viewer to work on 8.5

    Hi
    Now am using Crystal Report 8.5 with Visual Basic 6.0
    i want to use latest of crystal report with Visual basic 6.0
    can anyone suggest which version i have to use
    it must be compatible with Visual Basic 6.0
    Regards
    Abhi

  • How to display the print dialogbox in crystal reports viewer for visualstudio 2013 in wpf?

    Hi,
    In my wpf application when i click on print button i want to display the print dialog box for current report.
    Here i have written like as follows.
    1.MyCrystalReportsViewer.ViewerCore.ReportSource = reportDocument;
    2. MyCrystalReportsViewer.ViewerCore.PrintReport();
    The above two statements  is executed and displayed the report in CrystalReportViewer, but it doesn't show any print dialogbox.
    MyCrystalReportsViewer is name of the CrystalReportsVIewer control.
    Can any one help me to solve this one using code.

    Hi Sandeep,
    Did you download CR for VS SP 13 from this link?
    http://scn.sap.com/docs/DOC-7824
    First link is to integrate CR into VS.
    If you did then I suggest you do a Repair on both VS and CR for VS.
    Also, VS must be Pro or higher, CR will not work in VS 2013 Express.
    Do you have printers installed? Do not use Windows XPS printer, it has problems.
    Don

  • Parameterized Views for User Reports

    I would like to be able to define a view such as:
    create view dept_emps(p_dept in varchar2) as
    select * from emps where dept = p_dept);
    and use this view to define a SQL Dev drilldown report with SQL such as:
    select * from dept_emps(:DEPT)
    where :DEPT is a bind variable passed from a selected depts report row.
    Oracle apparently does not support parameterized view definitions as suggested above, but I have found an article by Tom Kyte on the issue of parameterizing views, where Tom suggests using DBMS_SESSION.SET_CONTEXT (called within a user package) to set context values that can be retrieved in a view using the SYS_CONTEXT function. I can get this approach to work at the SQL prompt to work around the lack of formal view parameters. I have a package which defines a procedure which sets context values that I can then retrieve within a view using the SYS_CONTEXT function.
    To use this approach when defining a SQL Developer user report, the SQL for the report would need to be logically something like (which works fine at an SQL prompt):
    exec ssuper_context.set_ctx('DEPT', :DEPT) - - Call user procedure to assign context variable 'DEPT' with bind value from parent report
    select * from dept_emps
    where view dept_emps uses function SYS_CONTEXT to return the value for context variable 'DEPT'.
    SQL Developer complains about this as the SQL for a user-defined report. Can anyone suggest how I might pass a bind value from a selected parent record to a view which implements a drilldown report?
    TIA Jon

    I met CSI at a kongress a few weeks ago and pressed them a bit on how this works. Eventually they fezzed up about the table read but mentioned that in the next release being developed it would be different...
    Problems with this is that the FM has a couple of limitations, so you cannot read all tables correctly... so you end up reading some of the wrong ones or taking the easy ones.
    Another option is to let the database itself do the hard work, to get back to the performance aspect.
    Anyway, for neither of these two do you need any tcode, so indeed we are drifting off topic...

  • Report execution for different variant and Broadcast

    Hi experts,
    i had a situation where i need to broadcast the same report for 100 vendors, but the information in the report will be different and specific to the vendor.
    can i create different variant for each vendor and execute the report at the time in background and broadcast that to the vendors.
    Is it possible for broadcasting the reports at a time
    any idea will be appreciated
    regards

    Hi akshay
    Is it like i can execute the report same time for different variants and broadcast that reports based on  that variant to different vendor
    for eg User  A has to view report with Variant X.
             User B has to view same report with variant Y
    and so on is this possible for us to do at a time
    or need to create different reprots for 100 vendors and broadcast them
    Hope if u have any document for broadcasting that shows the steps to do this can you please share

  • Hide the design view for the report

    Dear All,
    I would like to block or hide the design view for the Crystal report.
    Please let me know.
    Thanks,
    Raja

    Hi Raja,
    It is not possible to hide the design tab in Crystal Reports.  However,  in Crystal Reports 2008,  there is the ability to password protect a file.
    Regards,
    Wallie

  • Error after migration to Crystal Reports 12 for existing reports

    Hi,
    We had reports written using Crystal Reports Version 8.5. These reports were not modified for a long time. Recently, we had migrated to Crystal Reports 12 (2008). Some of the these existing reports were modified using the Crystal Reports 2008 designer. After installing our application (we ship Merge Module of Crystal Reports 12 i.e. 2008 which gets installed in GAC)
    1)  If we create new reports in 2008 designer and try to view these reports, it works as expected without any issue(s).
    2 ) However, if these modified reports are tried to be viewed, there is an error which states "Database Logon Failed".
    Details:
    CrystalDecisions.CrystalReports.Engine.LogOnException     {"Database logon failed."}
    ErrorID     CrystalDecisions.CrystalReports.Engine.EngineExceptionErrorID.LogOnFailed
    InnerException     {"Database logon failed."}
    Message      "Database logon failed."
    Source     "CrystalDecisions.ReportAppServer.DataSetConversion"
    Stack Trace        at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
    TargetSite     {Boolean ThrowDotNetException(System.Exception)}
    Also, it is worth to note that if we try to view these modified reports from any environment which has both Crystal Reports 10 and Crystal Reports 12 in GAC, then these reports work as expected.
    P.S.  We have mechanism in application's code to reset the database connections when any report is being viewed using ReportDocument class' method.
    From the above scenario I believe issue is specific to migration to Crystal Reports 12 (2008).  Any help /workaround to solve this problem will be highly appreciated.

    Make sure you have the latest SP for CR 2008  installed;
    https://smpdl.sap-ag.de/~sapidp/012002523100009038092009E/cr2008win_sp2.exe
    Ensure you are deploying SP 2 runtime;
    MSM
    https://smpdl.sap-ag.de/~sapidp/012002523100009159092009E/cr2008sp2_mm.zip
    MSI
    https://smpdl.sap-ag.de/~sapidp/012002523100009159002009E/cr2008sp2_redistinstall.zip
    If that does not help;
    1) Do these reports work in the designer?
    2) What database are you using and what is the connection type?
    3) Compare the dlls loading on the systems where this app works (environment which has both Crystal Reports 10 and Crystal Reports 12 in GAC) and a system that is giving you the error. Use the [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] utility.
    4) Open the reports in the designer and look at the properties in the Database menu -> Set Datasource Location. Check to see if there are any differences between the two reports.
    5) If there is a subreport in the report that causes the issue, remove it and see if the report works without the subreport.
    Ludek

  • :: NWA does not show table view for monitoring reports ::

    Hi,
    We are facing an issue in one of our portal system.
    I click on Portal index page, then I go to Net weaver Administrator --> Monitoring --> Java system reports.
    Here I get the resource utilization graphs.
    The graphs show proper values however when I click on table view it does not show any value or table at all.
    Then I click on Settings button, and click on Persistent radio button.
    It asks to enter the number of days for which the the data should be stored.
    I gave it as 2 days and click on Apply button.
    It shows a message saying "changes would be effective after restarting monitoring service".
    However when I go there i.e. NWA --> Administration --> Applications
    I get below services
    cafruntimemonitoring~ear                 
    com.sap.ip.bi.sdk.monitoring                 
    tclmwebadminmonitoravail~wd            
    tclmwebadminmonitorcomplib~wd            
    tclmwebadminmonitorprovider_ear            
    tclmwebadminmonitorstate~wd            
    tclmwebadminoverviewmonitoring~wd           
    tcmonitoringsysteminfo
    Would you kindly suggest which service from above list should be restarted ?
    Thank you, Regards,
    Girish Garje.

    I think what is being asked is "How do I expose a database view as a schema table in Configuration Manager?"
    This is accomplished by creating a database view within the WCC database schema (and with the WCC schema user as the view owner). The view then will appear as a table in the "table" tab in Configuration Manager.
    One caveat in 11g is that the user created by RCU does not have any privileges to read/create views in its own schema. You may need to grant privileges to views for the WCC schema user before this will work.

Maybe you are looking for

  • Ipod not showing up as a drive on my windows vista pc

    I just bought a new PC with windows vista OS. My ipod nano does not show up as an external drive. I have installed the new itunes and "transfered purchases". When I plug the USB cord in it shows up but only for a moment then disapears. I took it out

  • HT1368 Will the app that I put under my Wish List become free? If yes, will iTunes notify me?

    Will the app that I put under my Wish List become free? If yes, will iTunes notify me?

  • Can't Install Flash Player version 10.1!

    I've been trying to install Flash Player 10.1, and having difficulties I never had with previous versions. When I try to install it it comes up with this message: Error 1031: [PATH TO FLASH PLAYER] [WINDOWS ERROR CODE]: The file could not be written

  • Mac OSx Inventory Agent (followup)

    Hi guys, First I want to wish a Merry Christmas and Happy New Year to all you guys on the forum :) Second: I had the chance to work with the Mac OSx Inventory Only Agent and it didnt impress me much. Maybe some of you guys can help me change my mind

  • Shortcuts to switch tabs

    In Firefox, I can do command+n (where n is the tab number) and it'll switch to that tab. Is there a way to do this in Safari 3 or can I only do the left and right shortcuts?