Didn't try/need this before, I will see if I can find something like this.
Member 4382232
Posts
-
Show/Hide columns in report.rdlc localreport -
Ling to SQL Generic ExcuteMethodCall with parametersHi, I would like help with writing a generic ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters) that can take any number of input parameters and always 3 output parameters or is there another way to read output parameters because the help on ExecuteMethod call says "This API supports the .NET Framework infrastructure and is not intended to be used directly from your code." public class MyClass { ..... [Function(Name = "sp_Info_Change")] public bool Change() { int inVal1 = 1; string inVal2 = "Test"; int outVal1 = 0; string outVal2 = ""; string outVal3 = ""; return MyDataClass.ExecuteMethod(this, (MethodInfo)MethodInfo.GetCurrentMethod(), inVal1, inVal2, ref outVal1, ref outVal2, ref outVal3); } ..... } public class MyDataContextClass: DataContext { ..... public bool ExecuteMethod(object tableClass, MethodInfo method, [Parameter(DbType = "Int")] int inVal1, [Parameter(DbType = "Varchar(25)")] string inVal2, [Parameter(DbType = "Int")] ref int outVal1, [Parameter(DbType = "Varchar(500)"] ref string outVal2, [Parameter(DbType = "Varchar(25)")] ref string outVal3) { bool result = false; IExecuteResult xresult = ExecuteMethodCall(tableClass, method, inVal1, inVal2, outVal1, outVal2, outVal3); outVal1 = Convert.ToInt32(xresult.GetParameterValue(2).ToString()); outVal2 = xresult.GetParameterValue(3).ToString(); outVal3 = xresult.GetParameterValue(4).ToString(); if (outVal1 == 1) { result = true; } return result; } } Any help would be much appreciated Thank you
-
ReportViewer Export to Excel Numbers Formatted as TextHi, I have a local report running in asp.net 2 reportviewer. When I use the export to excel functionality of the reportviewer control, the numbers are exported as text in excel and I can not apply excel functions on the number fields. Do you know if there is a certain format I can use for excel to know its a number field. I used =FormatNumber(Fields!Balance.Value) AND =Format(Fields!Balance.Value,"### ### ##0.00") AND =Format(Fields!Balance.Value,"###,###,##0.00") none working. I removed the format all together and it still didn't make a difference. Please assist
-
SQL 2005 Reporting ServicesHi, I do not know if this is the right place to post my question. Please refer me to the appropriate place if this is not it. I set up a report server and created some rdl reports using .net. I published them successfully, now I would like to setup the subscriptions. When I read through the msdn and other articles on how to configure the report server for e-mail delivery, I did everything except for this: "Verify that the Report Server Windows service has Send As permissions on the SMTP server." Can anyone please tell me how do I do this. Thanx
-
ReportViewer InitialToggleState ignored?Hi, I have a reportviewer control with a local report which consists of a list control (in the list is a textbox for the group header and a table with details). My question is that although the InitialToggleState = Collapsed by default on the textbox which is also the details group of the list control, the group is always expanded at runtime. Are more settings required to be able to get the "+" next to the group header and details be collapsed? Please assist.
-
ReportViewer LocalReport does not render correctlyFinally! I have used different sources to get my solutions, some of which I got from codeproject. Here goes: default.aspx.cs: protected void btPrint_Click(object sender, EventArgs e) { RenderReport(); Response.Redirect("PrinterFriendly.aspx"); } private void RenderReport() { Warning[] warnings; string deviceInfo = "<DeviceInfo>" + " <OutputFormat>EMF</OutputFormat>" + " <PageWidth>10in</PageWidth>" + " <PageHeight>13in</PageHeight>" + " <MarginTop>0.0in</MarginTop>" + " <MarginLeft>0.0in</MarginLeft>" + " <MarginRight>0.0in</MarginRight>" + " <MarginBottom>0.0in</MarginBottom>" + "</DeviceInfo>"; m_streams = new List<Stream>(); ReportViewer.LocalReport.Render("Image", deviceInfo, CreateStream, out warnings); Session["MemStreamList"] = (List<Stream>)m_streams; } private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek) { Guid newid = Guid.NewGuid(); Stream stream = new FileStream(name + newid + "." + fileNameExtension, FileMode.Create); m_streams.Add(stream); return stream; } printerfriendly.aspx.cs: protected void Page_Load(object sender, EventArgs e) { List<Stream> memList = (List<Stream>)Session["MemStreamList"]; for (int i = 0; i < memList.Count; i++) { string imgString = "<img src=\"MultipleImaging.aspx?Index=" + i + "\">"; this.Controls.Add(new LiteralControl(imgString)); } } multipleimaging.aspx.cs: protected void Page_Load(object sender, EventArgs e) { if ((Session["MemStreamList"] != null) && Session["MemStreamList"].GetType().Equals(typeof(List<Stream>))) { List<Stream> images = (List<Stream>)Session["MemStreamList"]; int index = Int32.Parse(Request.Params.Get(0).ToString()); if (images[index].Length > 0) { try
-
ReportViewer LocalReport does not render correctlyHi, I have tried a different aproach: Every page is saved in the stream object. List consists of all pages. print_click(...) { m_streams = new List<Stream>(); ReportViewer.LocalReport.Render("Image", deviceInfo, CreateStream, out warnings); foreach (Stream stream in m_streams) stream.Position = 0; Session["MemStreamList"] = (List<Stream>)m_streams; Response.Redirect("PrinterFriendly.aspx"); } imager.aspx.cs: page_load(..) { Response.ContentType = "image/gif"; List<Stream> memList = new List<Stream>(); memList = Session["MemStreamList"]; for (int i = 1; i < memList.Count; i++) { System.Drawing.Image img = System.Drawing.Image.FromStream(memList[i]); } img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); } Problem is that now I only have the last page. Question: How do I create one image in response.outputstream for all images in list? Please help Thanx
-
ReportViewer LocalReport does not render correctlySorry the code did not paste corectly: string deviceInfo = "<DeviceInfo>" + " <OutputFormat>EMF</OutputFormat>" + " <PageWidth>10in</PageWidth>" + " <PageHeight>100in</PageHeight>" + " <MarginTop>0.0in</MarginTop>" + " <MarginLeft>0.0in</MarginLeft>" + " <MarginRight>0.0in</MarginRight>" + " <MarginBottom>0.0in</MarginBottom>" + "</DeviceInfo>";
-
ReportViewer LocalReport does not render correctlyWhat I have added to the above code: string deviceInfo = "" + "EMF" + "10in" + "100in" + "0.0in" + "0.0in" + "0.0in" + "0.0in" + ""; The pagewidth in the rdlc is 8.5in but for some reason it cuts of when rendered. The pagewidth setting above solves the columns being cut off (and still fits on a portrait pagesetup. Now, if I increase the pageheight it also includes the entire report vertically, BUT how do I calculate what the correct height must be, what happens with the above code is that it includes all rows of data plus a number of empty pages to make up for the 100inches, which is not what I want. Another problem that comes from this settings is that the first page is blank and the report starts printing on the second page. please give ideas. Thanx
-
ReportViewer Local report client side printing?No, I am still struggling
-
ReportViewer LocalReport does not render correctlyNo, I wish I had!
-
ReportViewer LocalReport does not render correctlyHi, I created a printer friendly page which renders the report as an "image" into a memory stream. On the printer friendly page I have an image button which displays the image. Some of the columns did not render and not all rows are included. Can anyone assist me with this issue. Also, how do I reference the memory stream without saving it in session (see *****************) Thanks Code: protected void btPrint_Click1(object sender, EventArgs e) { Warning[] warnings; string[] streamids; string mimeType; string encoding; string extension; byte[] bytes = ReportViewer.LocalReport.Render("Image", null, out mimeType, out encoding, out extension, out streamids, out warnings); MemoryStream s = new MemoryStream(bytes); Session["MemStream"] = s; ***************** Response.Redirect("PrinterFriendly.aspx"); } PrinterFriendly.aspx Imager.aspx.cs: protected void Page_Load(object sender, EventArgs e) { Response.ContentType = "image/gif"; System.Drawing.Image img = System.Drawing.Image.FromStream(Session["MemStream"]); ****** img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); }
-
ReportViewer Local report client side printing?Hi, I have created a local report in asp.net 2. What are my different options available to accomplish the client to be able to print this report on the client printer. If I use pdf format I get the report in portrait layout. (Is it possible to make it open a landscape pdf?) If I use javascript:window.print(); it adds blank spaces and remove the lines in the details rows. Are those my only options? Any help would be highly appreciated. Thanx
-
Create aon objectdatasource programaticallyThe solution was that I needed to set the gridview.DataSource = objDS. I previously set the gridview.DataSourceID = "ObjectDataSource1" which I thought is the same. ObjectDataSource objDS = new ObjectDataSource(); objDS.DataObjectTypeName = "Provider"; objDS.TypeName = "Providers"; objDS.SelectMethod = "PopulateProviders"; objDS.UpdateMethod = "Update"; objDS.ID = "ObjectDataSource1"; The solution was that I needed to set the gridview.DataSource = objDS. I previously set the gridview.DataSourceID = "ObjectDataSource1" which I thought is the same. Everything is working nice. Thanx
-
Create aon objectdatasource programaticallyI have tried: objDS.SelectMethod = "PopulateProviders"; //The sytax is correct here. as well as: objDS.SelectMethod = PopulateProviders(); in this instance I get the following error Cannot implicitly convert type 'System.Collections.Generic.List ' to 'string' ObjectDataSource objDS = new ObjectDataSource(); objDS.DataObjectTypeName = "VeriWeb_Administration.BusinessObjects.Provider"; objDS.TypeName = "VeriWeb_Administration.BusinessObjects.Providers"; objDS.SelectMethod = "PopulateProviders()"; objDS.UpdateMethod = "Update"; objDS.ID = "ObjectDataSource1"; Is the rest of the above code correct? I have never created an objectdatasource is code before. Thanx again
-
Create aon objectdatasource programaticallyHi, thanx for the reply but it has to be a string and PopulateProviders return a list<>
-
Create aon objectdatasource programaticallyHi, thanx for the reply but it has to be a string type.
-
Create aon objectdatasource programaticallyHi, I'm trying to create an objectdatasource in code and then bind a gridview. ObjectDataSource objDS = new ObjectDataSource(); objDS.DataObjectTypeName = "VeriWeb_Administration.BusinessObjects.Provider"; objDS.TypeName = "VeriWeb_Administration.BusinessObjects.Providers"; objDS.SelectMethod = "PopulateProviders()"; objDS.UpdateMethod = "Update(Provider item)"; objDS.ID = "ObjectDataSource1"; I get the following error on gridview.databind() : The Select operation is not supported by ObjectDataSource 'ObjectDataSource1' unless the SelectMethod is specified. Please help
-
How to pass value user control to user controlJust an idea, but maybe you can raise an event in the first user control, handle it in the aspx page and then set a property or execute a method in the second user control from within the eventhandler in the aspx page
-
GridView RowUpdating textbox.Text = ""Hi, I have written an user control with a gridview control, that does select, edit, update, cancel functionality. I have a question regarding the RowUpdating event. I bind my grid at runtime to a generic list<>, therefor I can't use the oldvalues, newvalues or the keys as you need a datasource control with an update command to be able to use these dictionaries. Another thing is that I have the autogeneratefields = true (as I am creating a generic gridview) and therefor I cannot use the gridview.columns[].extractvaluesfromcell as the columns count = columns created at design time to add the select, edit, update, cancel buttons. I have used the following code: ((TextBox)gridview.Rows[e.RowIndex].Cells[5].Controls[0]).Text which results in "". However the old values are still available. The newly typed data not available. Any help will be greatly appreciated. Thanx