Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET Slow-Loading , +
Heres what happen... I create an app using vb.net 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
        crParameterValues.Add(crParameterDiscreteValue)
        crParameterFieldLocation.ApplyCurrentValues(crParameterValues)
        '
        ' Set the Crytal Report Viewer control's source to the report document.
        '
        frmPrintID.CrystalReportViewer1.ReportSource = CR
 
       
        frmPrintID.Show()
        
        Me.Close()
Posted 16-Apr-13 6: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
0 OriginalGriff 515
1 Maciej Los 349
2 Richard MacCutchan 220
3 BillWoodruff 209
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 20 Oct 2013
Copyright © CodeProject, 1999-2014
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