Tuesday, May 17, 2011

HTTP Error 500.19 - Internal Server Error


From last two time installation and configuration IIS 7.0 on windows Server 2008 R2 I am having issue after application configure application IIS .. which showing error "HTTP Error 500.19 - Internal Server Error".



I tried different way to solved issue but for me following worked both time
Solution :
Try 1 : I added IIS_IUSER permission to Application - did not work.
Try 2 : Application pool --> Adavance Setting -- > Identity changed to Local System, Local Service, Network Service or IdentityAppPool... - did not work
Try 3 : I added Permission to Local Server\User and It worked..as charm :)
(Windows Authentication on and Anonymous off)







Try other Solutions might work for you
1)
http://social.msdn.microsoft.com/Forums/en-US/dotnetstocktradersampleapplication/thread/6e79cb01-ffb0-439c-8e1c-505a29b87671
2)
http://www.youtube.com/watch?v=vBNoTK31zPo
3)
http://www.winservermart.com/Howto/HTTP_Error_500_19_IIS_7.aspx
4)
http://forums.iis.net/p/1073585/1867893.aspx

I am not Windows / IIS Guru... I worked mostly Architect application, design and implementation ... but I try to figure out issue rather waiting for 2-3 days... and here what i found... updated me if something wrong or not feasible solution.. I am happy to improve myself.

Wednesday, April 28, 2010

Programmatically Generate Report and store as pdf or send as email

Every time going to Reporting service and generate report it's tedious work also some report takes longer with millions of data. User does not have time to click report generate button and wait for 10-15 minutes. Use need ready to use report with real time data. We can schedule service or Task and generate report in background and user get email on his/her schedule time. Here I tried to create some application and it's running very well on my production environment.
below if only basic structure of code.
1) Create New Windows / Web Application (depend on your requirment)
2) Add Web Refrence for Web Site / Service Refrence for Windows
http://SERVERNAME/ReportServer/ReportService2005.asmx
And
http://SERVERNAME/ReportServer/ReportExecution2005.asmx
3) If you are using .Net 3.5 can use WCF client, instead of web service client.
4) For excel, csv,web and xml --> try file extetion as .".xls",".csv",".html",".xml"


using System.Text;
using System.Windows.Forms;
using System.IO;

using System.Net.Mail;

private rs2005.ReportingService2005 rs;
private rsExecService.ReportExecutionService rsExec;


rs = new rs2005.ReportingService2005();
rsExec = new rsExecService.ReportExecutionService();

// Authenticate to the Web service using Windows credentials

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;

//// Assign the URL of the Web service

rs.Url = "http://SERVERNAME/ReportServer/ReportService2005.asmx";
rsExec.Url = http://SERVERNAME/ReportServer/ReportExecution2005.asmx;

string historyID = null;
string deviceInfo = null;
string format = "pdf";

// Byte[] Sendresults;
string encoding = String.Empty;
string mimeType = String.Empty;
string extension = String.Empty;
rsExecService.Warning[] warnings = null;
string[] streamIDs = null;
// Default Path;
string fileName = @"c:\samplereport.pdf";
// Get the report name
string _reportName = @"/FOLDER/REPORT_NAME";
string _historyID = null;
bool _forRendering = false;

ParameterValue[] _values = null;
DataSourceCredentials[] _credentials = null;
ReportParameter[] _parameters = null;
try
{
// Load the selected report.
rsExecService.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);

// Prepare report parameter.
rsExecService.ParameterValue[] parameters =
new rsExecService.ParameterValue[2];
// Place to include the parameter.
if (_parameters.Length > 0)
{
parameters[0] = new rsExecService.ParameterValue();
parameters[0].Label = "StartDate";
parameters[0].Name = "StartDate";
parameters[0].Value = DateTime.Now.Date.ToShortDateString();

parameters[1] = new rsExecService.ParameterValue();
parameters[1].Label = "EndDate";
parameters[1].Name = "EndDate";
parameters[1].Value = DateTime.Now.AddDays(1).ToShortDateString();
}
rsExec.SetExecutionParameters(parameters, "en-us");
//get pdf
byte[] Sendresults = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);

MeoryStream ms = new MemoryStream(Sendresults);
//send email
MailMessage mail = new MailMessage();
mail.Subject = "Test_Report " + DateTime.Now.ToString();
mail.To.Add("eMailName@@XYZ.com");
mail.From = new MailAddress("DoNotReply@XYZ.com");
mail.Attachments.Add(new Attachment(ms, string.Format("{0}_Document." + format, "Test_Reprots")));
SmtpClient smtp = new SmtpClient("smtp.XYZ.net");
smtp.Send(mail);

// Create a file stream and write the report as file
using (System.IO.FileStream stream = File.OpenWrite(fileName))
{
stream.Write(Sendresults, 0, Sendresults.Length);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/2c7d949b-5a3c-4443-b7f4-b20b4089d445

Monday, April 19, 2010

Some ways...

Chicago' 10
"Little fight"
yellow Dream (New York)

Drops of Life

Login failed (rsLogonFailed)

when setup using execution account on reporting Service Configuration and allow Domain user access to reports. To solve issue remove Execution Account or Reset the Password.




Friday, July 24, 2009

India,Dec 08

Some of the shots I took when I went to India last Dec,


Sunflower at filed


Chilly onions !


Camel & Sun (Tithal Beach)


Colors (Debarpada My village)


Lone Tree .. ! (Debarpada My village)


Sun Player (Tithal Beach)


Long Way!


Something you really like


Tricolors (Daman Beach)

Tuesday, July 14, 2009

Use Active directory using MS SQL 2005/08

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'ADSI'
,@useself=N'FALSE',@locallogin=NULL,@rmtuser='{Domain\UserName}',@rmtpassword=''


SELECT *

FROM OPENQUERY( ADSI,

'SELECT Name, SN, ST

FROM ''LDAP://AAM.NET''

WHERE objectCategory = ''Person'' AND

objectClass = ''user''')

Friday, May 8, 2009