C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Taking time to generate reports through remote server???


Posted Date: 18 Jun 2008      Total Responses: 0

Posted By: ATUL C KALAMKAR       Member Level: Silver     Points: 1




My problem is it is taking time to generate report form remmote client that local server,I have around 20000 or more record,in DB it is taking time around 5-10 seconds to generate reports in LOCAL SERVER but on remote server it takes around 10 mins to generate this report.
I have problem in the commented filed it has shown in commented field as
\\PROBLEMATIC CODE,it is taking time to fill the dataset,is there any oher way to fasten my report performance through remote server.
Please help me it is very urgent.

Should I user dataset,or any other property for that,




private void btnGenerate_Click(object sender, EventArgs e)
{

if (rbRegular.Checked)
{
RegularReportGenerate();
}

}


private void RegularReportGenerate()
{
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
dtpfrom = dateTimePickerFromDate.Value; 15thMay
dtpTo = dateTimePickerToDate.Value;
string ReportName, ReportAlias, ReportSource,ReportNo, Qry="", DBNo, DBName, SPName,ssql;
//string str_combo="" ;

if (Validate())
{

if (cmbReport.Text !="")
{
ArrayList ArList = Svsreportstbl.RetrieveObjectList("SELECT * FROM SVSReportsTbl where ReportCaption = '"+cmbReport.Text.Trim()+"'");
Svsreportstbl tbl = (Svsreportstbl)ArList[0];

ReportName = tbl.Reportname;
ReportAlias = tbl.Reportalias;
ReportSource = tbl.Reportsource;
ReportNo = tbl.Reportno;
DBNo = tbl.Dbno;
SPName = tbl.Spname;


if ( ReportName !="" && ReportAlias != "" && ReportSource !="" && DBNo !="")
{
DBName = GetDBName(DBNo);
if (DBName !="" )
{
#region "If DatabaseName is given"

if (ReportSource.Contains(","))
{
int len = ReportSource.Length;
int lenComm = ReportSource.IndexOf(",");
int diff = len - lenComm;
string ReportSource1 = ReportSource.Substring(0, lenComm);
string ReportSource2 = ReportSource.Substring(lenComm + 1, diff - 1);


Qry = "SELECT * FROM " + DBName + ".dbo." + ReportSource1 + " , " + DBName + ".dbo." + ReportSource2 + " where " + DBName + ".dbo." + ReportSource1 + ".ReportDate between '" + dateTimePickerFromDate.Text + "' and '" + dateTimePickerToDate.Text + "' and " + DBName + ".dbo." + ReportSource2 + ".ReportDate between '" + dateTimePickerFromDate.Text + "' and '" + dateTimePickerToDate.Text + "'"; }
else
{

Qry = "SELECT * FROM " + DBName + ".dbo." + ReportSource + " " + ReportAlias + " where ReportDate between '" + dateTimePickerFromDate.Text + "' and '" + dateTimePickerToDate.Text + "'"; }


#region Commented Code Existing

#endregion
#endregion
}
else
{
MessageBox.Show("Invalid database name.");
return;
#region " Commented If Database name is not given"
#endregion
}


#region "Show the report"

try
{

CrystalDecisions.Windows.Forms.CrystalReportViewer ReportViewer = new CrystalReportViewer();

ReportDocument rep = new ReportDocument();
// rep = new ReportDocument();
----------PROBLEMATIC CODE----------
DataSet ds = new DataSet();
OleDbDataAdapter sqlDA = new OleDbDataAdapter(Qry, connectionString); sqlDA.Fill(ds, "SVSClearingReport");
string path = AppDomain.CurrentDomain.BaseDirectory + "Reports\\IDBI-bank\\Reports\\" + ReportName;
rep.FileName = path;
rep.SetDatabaseLogon("sa", "sa"); //- rep.SetDataSource(ds.Tables[0]);
ReportViewer.ReportSource = rep;



MY VIEW:-I have set an indexed on idno,sequencenumber,and chqresultnumber of PHYCHEQUE table


CREATE VIEW [dbo].[SVSClearingReport]
AS
SELECT TOP 100 PERCENT p.ChequeDate as ReportDate, p.SorterNumber,
p.RunNumber, p.SequenceNumber, p.ChequeNumber,
p.BankNumber, p.BranchNumber, p.AccountNumber,
p.DocumentType, p.Amount, p.SendBank, p.SendBranch,
p.HostStatus, p.AccountRestriction, p.LoginName, idno,
ReasonText = (CASE WHEN rtrim(ltrim(p.returnreason))
IS NOT NULL THEN
(SELECT TOP 1 description
FROM returnreason with (nolock)
WHERE convert(varchar,returnreasoncd) = p.returnreason) ELSE ' ' END),
c.chqresultdetail
FROM cheque p with (nolock) , chequeresult c with (nolock)
WHERE p.chqresultnumber = c.chqresultnumber and idno not in (select idno from Temp_PhychequeMultipleReason with (nolock))
ORDER BY c.chqresultdetail,p.SorterNumber,
p.RunNumber, p.SequenceNumber
union all
select * from SVSClearingReport_MultipleReason







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.
Next : equation to Math ML
Previous : trim function
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use