开发者

How to use multiple tables in crystal reports?

I have a dataset and within that dataset I have 2 dataTableAdapteres.

The first datatable uses this query -

select * from a_object
inner join l_pageobject
on o_objectID = PO_ObjectID
inner join a_page
on po_pageid = p_pageid
inner join开发者_如何学运维 l_pagepermission
on p_pageid = pp_pageid
inner join a_permission
on P_permissionID = pp_permissionID
where p_description = 'testing.asp'
order by P_Name

and the second datatable uses -

select * from l_pagelink
inner join l_pageobject
on po_pageid = pl_pageid
inner join a_object
on o_objectID = po_ObjectID
inner join a_page
on pl_pageID = p_pageid
where p_description = 'testing.asp'
order by O_Name

I want to use both tables in a crystal report but cant seem to get it working.

Below is the code in c# that I have so far which ends up as an empty report.

public void reportOutput(string nameOfFile)
{
    string file;
    file = nameOfFile + ".pdf";

    ReportDataSet1 ds = new ReportDataSet1();

    CrystalReport1 objRpt = new CrystalReport1();
    objRpt.SetDataSource(ds);
    objRpt.ExportToDisk(ExportFormatType.PortableDocFormat, file);
}

How can I fix this?


First of all you need to populate the DataSet instance through Fill method of tableAdapter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜