--group by day
SELECT COUNT(* ),
Dateadd(DAY,Datediff(DAY,0,HireDate),0) 'day'
FROM Employees
GROUP BY Dateadd(DAY,Datediff(DAY,0,HireDate),0)
ORDER BY Dateadd(DAY,Datediff(DAY,0,HireDate),0) DESC
--group by Month
SELECT COUNT(* ),
Dateadd(MONTH,Datediff(MONTH,0,HireDate),0) 'Month'
FROM Employees
GROUP BY Dateadd(MONTH,Datediff(MONTH,0,HireDate),0)
ORDER BY Dateadd(MONTH,Datediff(MONTH,0,HireDate),0) DESC
Tuesday, September 16, 2008
SQL Server programming Group by day,Month ,Year
Monday, March 10, 2008
Executing client report from web application
{
DataSet1TableAdapters.authorsTableAdapter ds = new DataSet1TableAdapters.authorsTableAdapter();
ds.ClearBeforeFill = true;
DataSet1.authorsDataTable dt=new DataSet1.authorsDataTable();
ds.Fill(dt, "ca");
ReportViewer1.LocalReport.ReportPath = Server.MapPath("Pubs.rdlc");
ReportViewer1.LocalReport.SubreportProcessing += new Microsoft.Reporting.WebForms.SubreportProcessingEventHandler(subReports);
}
void subReports(object sender, SubreportProcessingEventArgs e)
{
if (e.ReportPath.Equals("ClientSubReport"))
{
if (e.Parameters.Count > 0)
{
DataSet2TableAdapters.employeeTableAdapter da = new DataSet2TableAdapters.employeeTableAdapter();
da.ClearBeforeFill = true;
DataSet2.employeeDataTable dt = new DataSet2.employeeDataTable();
da.Fill(dt);
e.DataSources.Add(new ReportDataSource("DataSet2_employee",dt));
}
}
}
Wednesday, December 05, 2007
Visual Studio » Visual Studio Report Controls » ReportServerCredentials
The application needs to be able to connect to the reporting service over the internet and the client machines do not need to be in the same domain.
This is the same authentication scenario that applies to viewing reports through HTTP using internet explorer and a URL to the reportserver virtual directory: Internet Explorer asks for a user and password.
Howerver, I want to specify the credentials programatically so the users don't need to enter them manually. Since the ReportViewer is connecting to the ReportServer website through HTTP (I guess its calling the webservice or even just displaying the HTML returned by the reportserver aspx), this should be pretty easy, just as its easy to setup a NetworkCredential(user, pass) for authentication when calling a webservice over http.
The solution follows
well , you should implement IReportServerCredential, and code example as follow : public class CustomReportCredentials : Microsoft.Reporting.WebForms.IReportServerCredentials // local variable for network credential. // use NetworkCredentials // not use FormsCredentials unless you have implements a custom autentication. } then use this as follows: IReportServerCredentials irsc = new CustomReportCredentials(userid,password, domain); The other code to set ServerReport property omit. hope you have a good day. |
Popular Posts
|