-
Notifications
You must be signed in to change notification settings - Fork 0
/
DashboardReport.aspx.cs
216 lines (169 loc) · 9.02 KB
/
DashboardReport.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Baldrich.DBRequest;
using System.Xml;
using EPolicy.XmlCooker;
using System.Configuration;
using System.Text.RegularExpressions;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using Microsoft.Reporting.WebForms;
using System.IO;
using System.Net;
using System.Collections.Specialized;
namespace EPolicy
{
public partial class DashboardReport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string dateFrom = (String)Session["dateFrom"];
string dateTo = (String)Session["dateTo"];
string CompanyName = (String)Session["CompanyName"];
string ReportSet = (String)Session["ReportSet"];
string posType = "EOI"; //Si la sesion de posType no trae, buscará EOI por Default
try
{
if (Session["PosType"] != "")
posType = (String)Session["PosType"];
}
catch
{
}
string BegPeriod = "0";
string EndPeriod = "0";
if (CompanyName == "%1%")
{
BegPeriod = "1";
EndPeriod = "5";
}
if (CompanyName == "%6%")
{
BegPeriod = "6";
EndPeriod = "10";
}
if (CompanyName == "%11%")
{
BegPeriod = "11";
EndPeriod = "15";
}
if (CompanyName == "%16%")
{
BegPeriod = "16";
EndPeriod = "20";
}
if (CompanyName == "%21%")
{
BegPeriod = "21";
EndPeriod = "25";
}
if (CompanyName == "%26%")
{
BegPeriod = "26";
EndPeriod = "31";
}
ReportViewer1.LocalReport.ReportPath = ("Reports/ReportSROSales.rdlc");
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
switch (ReportSet)
{
case "AllSales":
SROSalesTableAdapters.GetDashboardSROVentasReportsTableAdapter TaNormal =
new SROSalesTableAdapters.GetDashboardSROVentasReportsTableAdapter();
//SROSales.GetDashboardSROVentasReportsDataTable NormalDt =
//new SROSales.GetDashboardSROVentasReportsDataTable();
//TaNormal.Fill(NormalDt, dateFrom, dateTo, CompanyName);
Microsoft.Reporting.WebForms.ReportDataSource NormalDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)TaNormal.GetData(dateFrom,dateTo,CompanyName));
ReportViewer1.LocalReport.DataSources.Add(NormalDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
case "WeekSales":
SROSalesTableAdapters.GetDashboardSROVentasReportsByWeekDateTableAdapter TaDias =
new SROSalesTableAdapters.GetDashboardSROVentasReportsByWeekDateTableAdapter();
SROSales.GetDashboardSROVentasReportsByWeekDateDataTable DiasDt =
new SROSales.GetDashboardSROVentasReportsByWeekDateDataTable();
TaDias.Fill(DiasDt, dateFrom, dateTo, CompanyName);
Microsoft.Reporting.WebForms.ReportDataSource DiasDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)DiasDt);
ReportViewer1.LocalReport.DataSources.Add(DiasDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
case "PeriodSales":
SROSalesTableAdapters.GetDashboardSROVentasReportsByMonthDateTableAdapter TaPeriod =
new SROSalesTableAdapters.GetDashboardSROVentasReportsByMonthDateTableAdapter();
SROSales.GetDashboardSROVentasReportsByMonthDateDataTable PeriodDt =
new SROSales.GetDashboardSROVentasReportsByMonthDateDataTable();
TaPeriod.Fill(PeriodDt, dateFrom, dateTo, BegPeriod, EndPeriod);
Microsoft.Reporting.WebForms.ReportDataSource PeriodDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)PeriodDt);
ReportViewer1.LocalReport.DataSources.Add(PeriodDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
case "BankSales":
SROSalesTableAdapters.GetDashboardSROVentasReportsByBankTableAdapter TaBank =
new SROSalesTableAdapters.GetDashboardSROVentasReportsByBankTableAdapter();
SROSales.GetDashboardSROVentasReportsByBankDataTable BankDt =
new SROSales.GetDashboardSROVentasReportsByBankDataTable();
TaBank.Fill(BankDt, dateFrom, dateTo, CompanyName);
Microsoft.Reporting.WebForms.ReportDataSource BankDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)BankDt);
ReportViewer1.LocalReport.DataSources.Add(BankDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
case "PolicySales":
SROSalesTableAdapters.GetDashboardSROVentasReportsByPosTypeTableAdapter TaSold =
new SROSalesTableAdapters.GetDashboardSROVentasReportsByPosTypeTableAdapter();
SROSales.GetDashboardSROVentasReportsByPosTypeDataTable SoldDt =
new SROSales.GetDashboardSROVentasReportsByPosTypeDataTable();
TaSold.Fill(SoldDt, dateFrom, dateTo, CompanyName);
Microsoft.Reporting.WebForms.ReportDataSource SoldDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)SoldDt);
ReportViewer1.LocalReport.DataSources.Add(SoldDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
case "RegionSales":
SROSalesTableAdapters.GetDashboardSROVentasReportsByRegionAndPosTypeTableAdapter TaRegion =
new SROSalesTableAdapters.GetDashboardSROVentasReportsByRegionAndPosTypeTableAdapter();
SROSales.GetDashboardSROVentasReportsByRegionAndPosTypeDataTable RegionDt =
new SROSales.GetDashboardSROVentasReportsByRegionAndPosTypeDataTable();
TaRegion.Fill(RegionDt, dateFrom, dateTo, CompanyName, posType);
Microsoft.Reporting.WebForms.ReportDataSource RegionDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)RegionDt);
ReportViewer1.LocalReport.DataSources.Add(RegionDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
default:
SROSalesTableAdapters.GetDashboardSROVentasReportsTableAdapter ta =
new SROSalesTableAdapters.GetDashboardSROVentasReportsTableAdapter();
SROSales.GetDashboardSROVentasReportsDataTable dt =
new SROSales.GetDashboardSROVentasReportsDataTable();
ta.Fill(dt, dateFrom, dateTo, CompanyName);
Microsoft.Reporting.WebForms.ReportDataSource rptDataSource =
new Microsoft.Reporting.WebForms.ReportDataSource("SROSales", (DataTable)dt);
ReportViewer1.LocalReport.DataSources.Add(rptDataSource);
ReportViewer1.LocalReport.Refresh();
ReportViewer1.Visible = true;
break;
}
}
}
}
}