Crystal 보고서 뷰어에서 다음 단추를 클릭하면 데이터베이스에서 데이터를 다시 검색하는 대신 데이터 테이블에서 데이터를로드해야하므로 세션에 데이터를로드하려고합니다. 여기에 내 코드 ...세션로드 [페이지]로드 사용
ReportDocument rpt = new ReportDocument();
DataTable resultSet = new DataTable();
string reportpath = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.QueryString.Get("id") == "5")
{
string publication = Request.QueryString.Get("pub");
DateTime date = DateTime.Parse(Request.QueryString.Get("date"));
int pages = int.Parse(Request.QueryString.Get("pages"));
int sort = int.Parse(Request.QueryString.Get("sort"));
if (sort == 0)
{
reportpath = Server.MapPath("IssuesReport.rpt");
rpt.Load(reportpath);
DataTable resultSet1 = RetrievalProcedures.IssuesReport(date, publication, pages);
Session["Record"] = resultSet1;
}
DataTable report = (DataTable)Session["Record"];
rpt.SetDataSource(report);
CrystalReportViewer1.ReportSource = rpt;
이 코드를하려하지만 난 다음 버튼을 클릭 할 때 유효하지 않은 보고서 source..i 세션이 왜 그 날이 오류를주는 널 그게 전부 추측 것을 나에게 오류를 제공 간다 .
나는이 문제를 해결하는 방법을 모든 sugesstions을 ...
코드에 누락 된 중괄호가 모두 속해있는 경우 도움이됩니다. if 문 각각의 범위가 무엇인지 알기는 어렵습니다. – tvanfosson