Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP and Crystal Report help

Status
Not open for further replies.

natncm70

MIS
Jan 16, 2002
66
0
0
IN
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 <> &quot;&quot; Then
reportFileName = autofilespec
Else
reportFileName = &quot;DailyMISReport_new_11_02.rpt&quot;
End If
'strTitle = strdate
strTitle = str_sdate
strdate2 = strdate
strdate3 = strdate3

strdate4 = ( day2 & &quot;-&quot; & month2 & &quot;-&quot; & right(year2,2) ) & &quot;/&quot; & ( day1 & &quot;-&quot; & month1& &quot;-&quot; & right(year1,2) )
strdate5 = ( day2 & &quot;-&quot; & month2 & &quot;-&quot; & right(year2,2) ) & &quot;/&quot; & ( day3 & &quot;-&quot; & month3 & &quot;-&quot; & right(year3,2) )
Set session(&quot;oRpt&quot;) = session(&quot;oApp&quot;).OpenReport(basepath & reportFileName, 1)
session(&quot;oRpt&quot;).FormulaFields.GetItemByName(&quot;DATE3&quot;).Text = Chr(34) & strTitle & Chr(34)
session(&quot;oRpt&quot;).FormulaFields.GetItemByName(&quot;DATE2&quot;).Text = Chr(34) & strDate2 & Chr(34)
session(&quot;oRpt&quot;).FormulaFields.GetItemByName(&quot;DATE1&quot;).Text = Chr(34) & strDate3 & Chr(34)
session(&quot;oRpt&quot;).FormulaFields.GetItemByName(&quot;DATE4&quot;).Text = Chr(34) & strDate4 & Chr(34)
session(&quot;oRpt&quot;).FormulaFields.GetItemByName(&quot;DATE5&quot;).Text = Chr(34) & strDate5 & Chr(34)
If Err.Number <> 0 Then
Response.Write &quot;Error Occurred creating Report Object: &quot; & Err.Description
Set Session(&quot;oRpt&quot;) = Nothing
Set Session(&quot;oApp&quot;) = Nothing
Session.Abandon
Response.End
End If


set crtable = session(&quot;oRpt&quot;).Database.Tables.Item(1)
crtable.SetLogonInfo &quot;mis&quot;,&quot;&quot;, cstr(struser), cstr(strpass)
crtable.SetPrivateData 3, rs
If IsObject (session(&quot;oPageEngine&quot;)) Then
set session(&quot;oPageEngine&quot;) = nothing
End If

set session(&quot;oPageEngine&quot;) = session(&quot;oRpt&quot;).PageEngine
set session(&quot;oRpt&quot;) = nothing

Please help me


regards
 
When you print the records from the recordset, is it what you expected, i.e. only for one branch?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top