在水晶报表4.6中可以在程序中得到所选报表用到的不同表在9.0中如何得到当前表?

解决方案 »

  1.   

    程序是不知道的,
    只知道数据源但不知道用哪个表,报表是已经定义好的,原来的报表是用4.6做的 short num;
    short i,j;
    CString strTmp;
    num=m_CrystalReport.RetrieveLogonInfo();
    num=m_CrystalReport.RetrieveDataFiles();
    for (i=0;i<num;i++)
    {
    strTmp=m_CrystalReport.GetDataFiles(i);
    AfxMessageBox(strTmp);
    int n=strTmp.ReverseFind('.');
            strTmp=strTmp.Right(strTmp.GetLength()-n-1);//得到当前表名
            AfxMessageBox(strTmp);
    m_CrystalReport.SetDataFiles(i,strTmp);
    }
    m_CrystalReport.SetAction(1);
    m_bRptCreated = true;
      

  2.   

    delphi中可以这样得到:
    crpe是控件
    Crpe.Tables.Items[0].Name