Hello,
I am getting problem in ASP and Crystal Report.
I am having branch wise report. From the ASP page, I need to select one branch from aSP page and display the Crystal Report. But, I am getting all the branch report.
I am using ODBC connection in the Report.
How do I assign the Recordset into Crystal report.
strsql= "select * from DP_MIS.DAILY_MIS where branch='"&Request.Form("branch"
&"' and sdate='2003-02-11'"
rs.open strsql,conn
If autofilespec <> "" Then
reportFileName = autofilespec
Else
reportFileName = "DailyMISReport_new_11_02.rpt"
End If
'strTitle = strdate
strTitle = str_sdate
strdate2 = strdate
strdate3 = strdate3
strdate4 = ( day2 & "-" & month2 & "-" & right(year2,2) ) & "/" & ( day1 & "-" & month1& "-" & right(year1,2) )
strdate5 = ( day2 & "-" & month2 & "-" & right(year2,2) ) & "/" & ( day3 & "-" & month3 & "-" & right(year3,2) )
Set session("oRpt"
= session("oApp"
.OpenReport(basepath & reportFileName, 1)
session("oRpt"
.FormulaFields.GetItemByName("DATE3"
.Text = Chr(34) & strTitle & Chr(34)
session("oRpt"
.FormulaFields.GetItemByName("DATE2"
.Text = Chr(34) & strDate2 & Chr(34)
session("oRpt"
.FormulaFields.GetItemByName("DATE1"
.Text = Chr(34) & strDate3 & Chr(34)
session("oRpt"
.FormulaFields.GetItemByName("DATE4"
.Text = Chr(34) & strDate4 & Chr(34)
session("oRpt"
.FormulaFields.GetItemByName("DATE5"
.Text = Chr(34) & strDate5 & Chr(34)
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt"
= Nothing
Set Session("oApp"
= Nothing
Session.Abandon
Response.End
End If
set crtable = session("oRpt"
.Database.Tables.Item(1)
crtable.SetLogonInfo "mis","", cstr(struser), cstr(strpass)
crtable.SetPrivateData 3, rs
If IsObject (session("oPageEngine"
) Then
set session("oPageEngine"
= nothing
End If
set session("oPageEngine"
= session("oRpt"
.PageEngine
set session("oRpt"
= nothing
Please help me
regards
I am getting problem in ASP and Crystal Report.
I am having branch wise report. From the ASP page, I need to select one branch from aSP page and display the Crystal Report. But, I am getting all the branch report.
I am using ODBC connection in the Report.
How do I assign the Recordset into Crystal report.
strsql= "select * from DP_MIS.DAILY_MIS where branch='"&Request.Form("branch"
rs.open strsql,conn
If autofilespec <> "" Then
reportFileName = autofilespec
Else
reportFileName = "DailyMISReport_new_11_02.rpt"
End If
'strTitle = strdate
strTitle = str_sdate
strdate2 = strdate
strdate3 = strdate3
strdate4 = ( day2 & "-" & month2 & "-" & right(year2,2) ) & "/" & ( day1 & "-" & month1& "-" & right(year1,2) )
strdate5 = ( day2 & "-" & month2 & "-" & right(year2,2) ) & "/" & ( day3 & "-" & month3 & "-" & right(year3,2) )
Set session("oRpt"
session("oRpt"
session("oRpt"
session("oRpt"
session("oRpt"
session("oRpt"
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt"
Set Session("oApp"
Session.Abandon
Response.End
End If
set crtable = session("oRpt"
crtable.SetLogonInfo "mis","", cstr(struser), cstr(strpass)
crtable.SetPrivateData 3, rs
If IsObject (session("oPageEngine"
set session("oPageEngine"
End If
set session("oPageEngine"
set session("oRpt"
Please help me
regards