Crystal Report - Page 10
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 10 of 39 FirstFirst ... 7891011121320 ... LastLast
Results 136 to 150 of 580

Thread: Crystal Report

  1. #136
    Join Date
    Oct 2002
    Posts
    1

    Crystal Reports .NET

    Hi K. Babu,
    1)Does Crystal Reports for .NET contain all features as Crystal Reports 8.0 or 9.0 does ? I mean : support for SQL DB stored pictures display etc...
    2)Is it possible to configure on run-time the Data source of my report, not only to change the LogOnInfo ? If so, how can I do that ?
    Thanks.
    Share on Google+

  2. #137
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Crystal Reports

    Sorry, I could not serve all developers doubts for long time, because of my busy work.

    Now, Iam little relax
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu
    Share on Google+

  3. #138
    Join Date
    May 2002
    Location
    Springfield MO
    Posts
    17

    Connection Problems

    Im trying to connect to Pervasive SQL data base. The report works fine except when I try to access it thru VB. I am also trying to use the CRviewer in VB. I can use this all just fine when using SQL and our normal databases. But now Im trying to create some reports for other departments. My code...

    Dim CrxApp As New CRAXDRT.Application
    Dim CrxRpt As CRAXDRT.Report

    Private Sub Form_Load()
    Dim rptfile As String

    rptfile = "C:\CrystalReports\test5.rpt"
    Set CrxRpt = CrxApp.OpenReport(rptfile)
    CrxRpt.Database.LogOnServer "PDSODBC.DLL", "10.0.0.34", "DATABASE", "USERID", "PASSWORD"

    CRViewer1.ReportSource = CrxRpt
    CRViewer1.ViewReport
    end sub

    -----

    The error I get is. "Server has not yet been Opened"

    Is there a way to set this UserId and password in the report itself? or have I just got something wrong in the Logonserver line? Im totaly confused.
    Nothin aint worth nothin... but its free
    Share on Google+

  4. #139
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Re: Connection Problems

    hi,

    Try to set server username & password in direct ODBC DSN, which is available in coltrol panel.

    Then we will go for next step.

    Thanks
    K.Babu

    Originally posted by JimB
    Im trying to connect to Pervasive SQL data base. The report works fine except when I try to access it thru VB. I am also trying to use the CRviewer in VB. I can use this all just fine when using SQL and our normal databases. But now Im trying to create some reports for other departments. My code...

    Dim CrxApp As New CRAXDRT.Application
    Dim CrxRpt As CRAXDRT.Report

    Private Sub Form_Load()
    Dim rptfile As String

    rptfile = "C:\CrystalReports\test5.rpt"
    Set CrxRpt = CrxApp.OpenReport(rptfile)
    CrxRpt.Database.LogOnServer "PDSODBC.DLL", "10.0.0.34", "DATABASE", "USERID", "PASSWORD"

    CRViewer1.ReportSource = CrxRpt
    CRViewer1.ViewReport
    end sub

    -----

    The error I get is. "Server has not yet been Opened"

    Is there a way to set this UserId and password in the report itself? or have I just got something wrong in the Logonserver line? Im totaly confused.
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu
    Share on Google+

  5. #140
    Join Date
    May 2002
    Location
    Springfield MO
    Posts
    17

    still not working

    Thanks for suggestion. I tried setting Username and Password in Control Panel and am getting the same exact error. I did a little research and found that others are having the same problem with LogonServer.

    Info at : http://support.crystaldecisions.com/...s/c2006666.asp

    Sadly, thier suggestion of using this code instead :
    Report.Database.Tables(1).SetLogOnInfo "server", "database", "UID", "PWD"
    does not work either.

    Our next attempt today is going to be to install CR and VB on the server and see if we can access and call it from there. I have my doubts about this as well, but at this point am willing to try.
    Nothin aint worth nothin... but its free
    Share on Google+

  6. #141
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Re: still not working

    Try first simple reports, and then step by step we will move all kind of reports.

    K.Babu

    Originally posted by JimB
    Thanks for suggestion. I tried setting Username and Password in Control Panel and am getting the same exact error. I did a little research and found that others are having the same problem with LogonServer.

    Info at : http://support.crystaldecisions.com/...s/c2006666.asp

    Sadly, thier suggestion of using this code instead :
    Report.Database.Tables(1).SetLogOnInfo "server", "database", "UID", "PWD"
    does not work either.

    Our next attempt today is going to be to install CR and VB on the server and see if we can access and call it from there. I have my doubts about this as well, but at this point am willing to try.
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu
    Share on Google+

  7. #142
    Join Date
    May 2002
    Location
    Springfield MO
    Posts
    17

    Simple Reports

    The report we are trying to use is as about as simple as it gets. Just one file involved and only 5 fields.

    What is weird is that I can access the file in VB thru data Environment, and even put fields in a listview.

    I can also print the report and access all the data from Cystal reports developer no problem.

    I can print any other report from all our other databases (we have several) that is NOT pervasive.

    The only problem is when I try to access that particular report from VB.

    I dont know what the solution is. I would be happy if it would let me access data even by inputting a password each time.

    I was hoping there was a way to save the password info in the report itself, but I cant figure it out.

    So far, we have had no success with VB and CR on the server either. Strange.

    Thanks for you help...
    Nothin aint worth nothin... but its free
    Share on Google+

  8. #143
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Re: Simple Reports

    use logoninfo without pwd and uid, if field is empty, it will prompt user name and password at run time.

    K.Babu

    crCommon.LogonInfo(0) = "dsn=;uid=;pwd=chennai_;dsq="

    Originally posted by JimB
    The report we are trying to use is as about as simple as it gets. Just one file involved and only 5 fields.

    What is weird is that I can access the file in VB thru data Environment, and even put fields in a listview.

    I can also print the report and access all the data from Cystal reports developer no problem.

    I can print any other report from all our other databases (we have several) that is NOT pervasive.

    The only problem is when I try to access that particular report from VB.

    I dont know what the solution is. I would be happy if it would let me access data even by inputting a password each time.

    I was hoping there was a way to save the password info in the report itself, but I cant figure it out.

    So far, we have had no success with VB and CR on the server either. Strange.

    Thanks for you help...
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu
    Share on Google+

  9. #144
    Join Date
    Jun 2002
    Posts
    8

    Question

    Hi.

    I have a problems with closing reports during run-time using Crystal Report Designer Component (RDC) from
    Crystal Repotrs 8.5 with Visual C++ 6.0. In spite of I'm using VC++, the problem is not VC-related, so I will be glad even if you will show me how to do this in VB. I have the following member variables defined in my appilication CWinApp-derived
    class:

    IApplicationPtr m_pApplication;
    IReportPtr m_pReport;
    IFieldObjectPtr m_pobjDetail[3]; // fields pointers array for three objects
    ITextObjectPtr m_pobjHeader[3]; // text pointers array for three objects
    ITextObjectPtr m_pobjFooter; // fields pointer for report footer
    CCrystalReportViewer4* m_pCryst;
    CAdodc m_ctlADODC; // Microsoft ADO Data Control

    At application startup I'm initializing m_pApplication and creating CCrystalReportViewer4 object:

    ...

    m_pApplication.CreateInstance("CrystalRuntime.Application");
    m_pCryst=new CCrystalReportViewer4;

    ...

    After that I'm creating ADO Data Control window. When user selects a new database, I'm setting new
    ADO record source and creating new report during run-time at the following manner:

    ISectionPtr pSection,pHeaderSection,pFooterSection;
    ISectionPtr pGroupSection;

    ...

    // get reference to my ADO recordset
    CAdodc& refADO=m_ctlADODC;
    C_Recordset& rc=refADO.GetRecordset();

    // creating a new report (***)
    m_pReport=m_pApplication->NewReport();

    // add database to a report (THE REASON OF MY HEADACHE)
    m_pReport->Database->Tables->Add("",vTemp,_variant_t((IDispatch *)rc.m_lpDispatch,true),vTemp,"p2smon.dll");

    // get the Detail section using "D" and Header section using "PH" as the index
    pSection=m_pReport->Sections->GetItem("D");
    pHeaderSection=m_pReport->Sections->GetItem("PH");
    pFooterSection=m_pReport->Sections->GetItem("PF");

    // add data to the report's Header section
    m_pobjHeader[0]=pHeaderSection->AddTextObject("Field1",400,0);
    m_pobjHeader[1]=pHeaderSection->AddTextObject("Field2",1100,0);
    m_pobjHeader[2]=pHeaderSection->AddTextObject("Field3",2900,0);

    // add data to the report's Detail section
    m_pobjDetail[0]=pSection->AddFieldObject("{ado.Field1}",400,0);
    m_pobjDetail[1]=pSection->AddFieldObject("{ado.Field2}",1100,0);
    m_pobjDetail[2]=pSection->AddFieldObject("{ado.Field3}",2900,0);

    // add data to the report's Footer section
    _bstr_t bstrMessage("My report footer");
    m_pobjFooter=pFooterSection->AddTextObject(bstrMessage,0,0);
    ::SysFreeString(bstrMessage);

    // pass the report to the viewer and preview the report
    m_pCryst->SetReportSource(NULL);
    m_pCryst->SetReportSource(m_pReport);
    m_pCryst->Zoom(100);
    m_pCryst->ViewReport();

    ...

    Above code works fine and I can see a valid report.
    When user closes current database, I'm trying to close ADO recordset and report:

    C_Recordset& rc=m_ctlADODC.GetRecordset();
    if (rc.m_lpDispatch!=NULL) rc.Close(); // close recordset if it wasn't closed previously

    // destroy footer since it doesn't refresh
    pSection=m_pReport->Sections->GetItem("D");
    pHeaderSection=m_pReport->Sections->GetItem("PH");
    pFooterSection=m_pReport->Sections->GetItem("PF");
    for (int j=0;j<3;j++) {
    if (m_pobjHeader[j]!=NULL) pHeaderSection->DeleteObject(_variant_t(& *m_pobjHeader[j]));
    if (m_pobjDetail[j]!=NULL) pSection->DeleteObject(_variant_t(& *m_pobjDetail[j]));
    m_pobjHeader[j]=NULL; m_pobjDetail[j]=NULL;
    }
    if (m_pobjFooter!=NULL) pFooterSection->DeleteObject(_variant_t(& *m_pobjFooter));
    m_pobjFooter=NULL;

    // destroy report data
    j=m_pReport->Database->Tables->GetCount();
    while (j) {
    m_pReport->Database->Tables->Delete(j);
    j--;
    }
    m_pCryst->SetReportSource(NULL);
    m_pCryst->DestroyWindow();
    m_pReport->Release(); // HERE IS I'V GOT AN ERROR. HOW CAN I CLOSE OR
    m_pReport=NULL; // DISCONNECT REPORT FROM ADO RECORDSET PROPERLY
    // TO PREVENT DATABASE FROM STAYING LOCKED?

    When I comment the last string ("m_pReport=NULL;"), the database stay locked and the error appear
    during recreating report at line commented with "***" ("m_pReport=m_pApplication->NewReport();").
    Could anybody advise how can I destroy created report properly (since there is no such method as
    CloseReport at IApplicationPtr, or related method) to reuse the m_pReport for the next report and
    prevent database from staying locked? Thank you very much!

    P.S. Where can I get entire documentation on Crystal Report Designer Component (RDC)?
    See you.
    Share on Google+

  10. #145
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Crystal Reports

    Close first crystal report after that close recordset and then close tables

    example:

    ({[....]}) first open last close, second open second close, last open first close.

    Try this sequence, that may slove your problem.

    yours
    K.Babu


    Originally posted by demask
    Hi.

    I have a problems with closing reports during run-time using Crystal Report Designer Component (RDC) from
    Crystal Repotrs 8.5 with Visual C++ 6.0. In spite of I'm using VC++, the problem is not VC-related, so I will be glad even if you will show me how to do this in VB. I have the following member variables defined in my appilication CWinApp-derived
    class:

    IApplicationPtr m_pApplication;
    IReportPtr m_pReport;
    IFieldObjectPtr m_pobjDetail[3]; // fields pointers array for three objects
    ITextObjectPtr m_pobjHeader[3]; // text pointers array for three objects
    ITextObjectPtr m_pobjFooter; // fields pointer for report footer
    CCrystalReportViewer4* m_pCryst;
    CAdodc m_ctlADODC; // Microsoft ADO Data Control

    At application startup I'm initializing m_pApplication and creating CCrystalReportViewer4 object:

    ...

    m_pApplication.CreateInstance("CrystalRuntime.Application");
    m_pCryst=new CCrystalReportViewer4;

    ...

    After that I'm creating ADO Data Control window. When user selects a new database, I'm setting new
    ADO record source and creating new report during run-time at the following manner:

    ISectionPtr pSection,pHeaderSection,pFooterSection;
    ISectionPtr pGroupSection;

    ...

    // get reference to my ADO recordset
    CAdodc& refADO=m_ctlADODC;
    C_Recordset& rc=refADO.GetRecordset();

    // creating a new report (***)
    m_pReport=m_pApplication->NewReport();

    // add database to a report (THE REASON OF MY HEADACHE)
    m_pReport->Database->Tables->Add("",vTemp,_variant_t((IDispatch *)rc.m_lpDispatch,true),vTemp,"p2smon.dll");

    // get the Detail section using "D" and Header section using "PH" as the index
    pSection=m_pReport->Sections->GetItem("D");
    pHeaderSection=m_pReport->Sections->GetItem("PH");
    pFooterSection=m_pReport->Sections->GetItem("PF");

    // add data to the report's Header section
    m_pobjHeader[0]=pHeaderSection->AddTextObject("Field1",400,0);
    m_pobjHeader[1]=pHeaderSection->AddTextObject("Field2",1100,0);
    m_pobjHeader[2]=pHeaderSection->AddTextObject("Field3",2900,0);

    // add data to the report's Detail section
    m_pobjDetail[0]=pSection->AddFieldObject("{ado.Field1}",400,0);
    m_pobjDetail[1]=pSection->AddFieldObject("{ado.Field2}",1100,0);
    m_pobjDetail[2]=pSection->AddFieldObject("{ado.Field3}",2900,0);

    // add data to the report's Footer section
    _bstr_t bstrMessage("My report footer");
    m_pobjFooter=pFooterSection->AddTextObject(bstrMessage,0,0);
    ::SysFreeString(bstrMessage);

    // pass the report to the viewer and preview the report
    m_pCryst->SetReportSource(NULL);
    m_pCryst->SetReportSource(m_pReport);
    m_pCryst->Zoom(100);
    m_pCryst->ViewReport();

    ...

    Above code works fine and I can see a valid report.
    When user closes current database, I'm trying to close ADO recordset and report:

    C_Recordset& rc=m_ctlADODC.GetRecordset();
    if (rc.m_lpDispatch!=NULL) rc.Close(); // close recordset if it wasn't closed previously

    // destroy footer since it doesn't refresh
    pSection=m_pReport->Sections->GetItem("D");
    pHeaderSection=m_pReport->Sections->GetItem("PH");
    pFooterSection=m_pReport->Sections->GetItem("PF");
    for (int j=0;j<3;j++) {
    if (m_pobjHeader[j]!=NULL) pHeaderSection->DeleteObject(_variant_t(& *m_pobjHeader[j]));
    if (m_pobjDetail[j]!=NULL) pSection->DeleteObject(_variant_t(& *m_pobjDetail[j]));
    m_pobjHeader[j]=NULL; m_pobjDetail[j]=NULL;
    }
    if (m_pobjFooter!=NULL) pFooterSection->DeleteObject(_variant_t(& *m_pobjFooter));
    m_pobjFooter=NULL;

    // destroy report data
    j=m_pReport->Database->Tables->GetCount();
    while (j) {
    m_pReport->Database->Tables->Delete(j);
    j--;
    }
    m_pCryst->SetReportSource(NULL);
    m_pCryst->DestroyWindow();
    m_pReport->Release(); // HERE IS I'V GOT AN ERROR. HOW CAN I CLOSE OR
    m_pReport=NULL; // DISCONNECT REPORT FROM ADO RECORDSET PROPERLY
    // TO PREVENT DATABASE FROM STAYING LOCKED?

    When I comment the last string ("m_pReport=NULL;"), the database stay locked and the error appear
    during recreating report at line commented with "***" ("m_pReport=m_pApplication->NewReport();").
    Could anybody advise how can I destroy created report properly (since there is no such method as
    CloseReport at IApplicationPtr, or related method) to reuse the m_pReport for the next report and
    prevent database from staying locked? Thank you very much!

    P.S. Where can I get entire documentation on Crystal Report Designer Component (RDC)?
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu
    Share on Google+

  11. #146
    Join Date
    Nov 2002
    Posts
    3

    unbounded field in Crystal Report .Net

    Hi,

    I need to design a report. Most of the data are from one dataset. There is one field that comes from outside this dataset. I don't want to use two datasources in the report or combining two datasets into one source. I am considering to use unbounded field for this data. And assign a value to it programmatically. But I can't find info on how to do it.

    Could ponit direction for me? Is unbounded fiels a good solution for the case?

    Thanks very much.

    Glen Chen
    Share on Google+

  12. #147
    Join Date
    Nov 2002
    Posts
    3
    Hi,:

    I am using crystal report visual studio.net, asp.net with c#. Crystal report creates a parameter field autmatically when I create a linked subreport. How do I retrive value of the parameter field from ASP.Net code ?

    Thanks.
    Share on Google+

  13. #148
    Join Date
    Sep 2002
    Posts
    22

    number of records per page in crystal reports

    hai babu,

    i am using crystal reports 4.5. i want to pass a value from vb , which is the number records per page in crystal reports.

    so how to?

    thank u
    sthota
    Share on Google+

  14. #149
    Join Date
    Aug 1999
    Location
    India, TamilNadu, Chennai.
    Posts
    269

    Re: number of records per page in crystal reports

    if you want to restrict number of lines per page, you don't need to pass the value from vb, you can set directly from crystal report design time, leave blank space at page footer group, this will reduce number of records per page.

    yours,
    Babu

    Originally posted by sthota
    hai babu,

    i am using crystal reports 4.5. i want to pass a value from vb , which is the number records per page in crystal reports.

    so how to?

    thank u
    sthota
    Please avoid sending emails to my personal mail:
    write your doubts as thread in Codeguru
    Crystal Reports Forum
    .

    This will help all people having similar matters, and will let people who know solutions on the specific topic
    share their knowledge.

    Visit my company web site (Qmax Test Equipments Private Limited)

    Yours friendly,
    K.Babu
    Share on Google+

  15. #150
    Join Date
    Sep 2002
    Posts
    22

    crystal report

    hai babu,

    thank you very much for ur reply. but in my application user will select the number of lines per page. based on that i have to show report.

    that is the problem. due to this, i cannot fix the report by increasing the page footer. so what should i do now?

    thank u
    sthota
    Share on Google+

Page 10 of 39 FirstFirst ... 7891011121320 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center