Click here to Skip to main content
13,149,738 members (56,419 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
Heres what happen... I create an app using that creates ID Card with picture and little details such as ID Picture, Barcode and Name... In my project I use a Windows XP machine... It runs very well... then I start to create a setup file.. I try it first here in my Windows XP so I install it here.. When I open the .exe file and start printing ID Card... It runs smoothly ... Then I deploy it now on a Windows 7 Machine... I install everything needed... the system runs very well... but the opening of the of ID Card form was so slow... it takes almost 5mins to show the ID Card form with crystal report viewer .... I dont know what happen here because there is no wrong with the code... I dont know the reason why it should take a very long time to open it ... I try some tutorials they said that it should run a dummy crystal report viewer so the CRengine will run... I try it but I got the same result.. still slow..

here's the code

Dim CR As New ReportDocument
        CR.Load(Application.StartupPath + "\IDcr.rpt")
        ' Declare the parameter related objects.
        Dim crParameterDiscreteValue As ParameterDiscreteValue
        Dim crParameterFieldDefinitions As ParameterFieldDefinitions
        Dim crParameterFieldLocation As ParameterFieldDefinition
        Dim crParameterValues As ParameterValues
        ' Get the report's parameters collection.
        DirectCast(CR.ReportDefinition.ReportObjects("Text9"), TextObject).Text = txtName.Text
        DirectCast(CR.ReportDefinition.ReportObjects("Text11"), TextObject).Text = txtAddress.Text
        DirectCast(CR.ReportDefinition.ReportObjects("Text12"), TextObject).Text = txtBarcode.Text
        crParameterFieldDefinitions = CR.DataDefinition.ParameterFields
        ' Set the first parameter
        ' - Get the parameter, tell it to use the current values vs default value.
        ' - Tell it the parameter contains 1 discrete value vs multiple values.
        ' - Set the parameter's value.
        ' - Add it and apply it.
        ' - Repeat these statements for each parameter.
        crParameterFieldLocation = crParameterFieldDefinitions.Item("MemPic")
        crParameterValues = crParameterFieldLocation.CurrentValues
        crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
        crParameterDiscreteValue.Value = txtSID.Text
        ' Set the Crytal Report Viewer control's source to the report document.
        frmPrintID.CrystalReportViewer1.ReportSource = CR
Posted 16-Apr-13 5:29am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170924.2 | Last Updated 20 Oct 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100