|
here is my code.
Response.Clear();
gvCycleRpt.Columns[8].Visible = false;
string style = @" .text { mso-number-format:\@; } ";
Response.AddHeader("content-disposition", "attachment;filename=CycleReport.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
StringWriter StringWriter = new System.IO.StringWriter();
HtmlTextWriter HtmlTextWriter = new HtmlTextWriter(StringWriter);
gvCycleRpt.RenderControl(HtmlTextWriter);
// Style is added dynamically
Response.Write(style);
Response.Write(StringWriter.ToString());
Response.End();
gvCycleRpt.Columns[8].Visible = true;
Thanks & regards
Biju S
|
|
|
|
|
itsbijusamuel wrote: Response.Clear();
gvCycleRpt.Columns[8].Visible = false;
string style = @" .text { mso-number-format:\@; } ";
Response.AddHeader("content-disposition", "attachment;filename=CycleReport.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
StringWriter StringWriter = new System.IO.StringWriter();
HtmlTextWriter HtmlTextWriter = new HtmlTextWriter(StringWriter);
gvCycleRpt.RenderControl(HtmlTextWriter);
// Style is added dynamically
Response.Write(style);
Response.Write(StringWriter.ToString());
Response.End();
gvCycleRpt.Columns[8].Visible = true;
Response.Clear();<br />
<br />
gvCycleRpt.Columns[8].Visible = false;<br />
string style = @"<style> .text { mso-number-format:\@; } </style> ";<br />
Response.AddHeader("content-disposition", "attachment;filename=CycleReport.xls");<br />
Response.Charset = "";<br />
Response.ContentType = "application/vnd.xls";<br />
StringWriter StringWriter = new System.IO.StringWriter();<br />
HtmlTextWriter HtmlTextWriter = new HtmlTextWriter(StringWriter);<br />
gvCycleRpt.RenderControl(HtmlTextWriter);<br />
StringBuilder sb = new StringBuilder();<br />
sb.Append(style);<br />
sb.Append(StringWriter.ToString());<br />
Response.Write(sb.ToString());<br />
Response.End();<br />
gvCycleRpt.Columns[8].Visible = true;
|
|
|
|
|
Hi All,
I want to change the UpdateText of a CommandField(Edit) on runtime in GridView.
For eg:
Now my defalt edit command has UpdateText as Edit. based on a condition i have to change the text to 'Approve'.
kindly some one help me achieve this.
Thanks and Regards,
Biju S.
|
|
|
|
|
itsbijusamuel wrote: Now my defalt edit command has UpdateText as Edit. based on a condition i have to change the text to 'Approve'
Click the Edit Columns in the Smart Tag menu of the GridView. Select the CommandField, you can change the Text of any field there.
Don't post again again...
|
|
|
|
|
I need to do this on runtime and not in design mode.
|
|
|
|
|
itsbijusamuel wrote: I need to do this on runtime and not in design mode.
Better use Template Item and add the controls whatever you want and change the Text whenever you want...
|
|
|
|
|
Hi all,
i need a suggestion ... I'm currently developing a small security application which secure entities depend on user permissions to access these entities.
my problem is: i have more than 50 permission every one of them has its own parameters for example a permission named 'access resource' need to specify the resource type which may be binded to another set of values and so one , once the user select the permission the input controls should be populated and request the user to enter these values.
how can i implement a generic permissions input ... without design the 50 permission inputs screen. ??
any idea ???
Hosam Kamel
Software Developer
|
|
|
|
|
One way to manage that many permissions is to group them into roles.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.
I have two SQL Server instances installed.
1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)
But when i try to add a database to my VS website project I get the following error:
Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925
I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)
and changed the "SQLEXPRESS" to "USERLT\SQL2005".
But I still get the same error message. Any ideas how i can resolve this issue?
|
|
|
|
|
Hello all!
I want to have a input file dialog on a button click much like the dialog which opens when we click the browse button on the FileUpload control.
Thankyou
Waiting in anticipation
Sam
-- modified at 12:23 Sunday 10th June, 2007
Bye
|
|
|
|
|
I'm afraid you will need an activex control for that. Normally you can't do that with asp.net. Depending of course on what you want to do with the dialog.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
Suppose that I have to do some encryption in my database. Those who have dealt with this stuff may already know that it's recommended to encrypt the encryption key using something like a machine key and storing them in registry or leave the key management to something like DPAPI.
Would someone please tell me what the problem is with simply storing the encryption key in a text file (in a plain text format) and then storing it in a folder whose read access been restricted to be available only to ASP.NET Process Identity through ACL permissions?
I mean, what DPAPI does is that it stores a secret key in windows registry whose access is restricted using ACL permissions. So, what's the difference if we simply store the key in a restricted folder as mentioned above?
Thanks in advance for any answer
Maysam
|
|
|
|
|
Hi,
I must add two neccessary namespaces into my all pages but it is boring. There is a way that i add these namespace only once and all pages use them ?
Thanks and Regards.
|
|
|
|
|
No
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
but it must be i saw it somewhere but i cant remember..
|
|
|
|
|
Hey,
I have a database and it contains article table so this table contains two field named Header and Content. Then i wanna show this data in a gridview control but there are two pages. the first one contains just label which is used to show any article's header and another label which is used to show some piece of article's content text. But how can i show some piece of article's content text to the user. For example i wanna get 5000 letters from begining of an article's content which is preserved in database.It is said there is an query to handle this.But i couldnt find that query.
Please help me. Thanks and regards..
|
|
|
|
|
Use the SUBSTRING function (or SUBSTR for Oracle) like
SELECT header, SUBSTRING(content, 0, 5000)
|
|
|
|
|
Thanks man
|
|
|
|
|
Hi,
i used the custom sqlsitemapprovider which is in this web : http://msdn.microsoft.com/msdnmag/issues/06/02/wickedcode/default.aspx?loc=&fig=true#fig5 but in this sample they used sqlsitemapprovider as a default sitemapprovider i dont wanna use it as a default and i wanna send a paramater which is used to filter datas to that class. I modified that class and i can take a sitemapprovider back and i wanna show it a sitemappath data source programmaticaly. i wanna create an instance object of sitemappath datasource and i wanna bind it to that class and then i wanna add a treeview control to the page then i wanna bind it to the sitemapdatasource programmaticaly too..
Thanks for your attetion.
Regards...
|
|
|
|
|
Ok i made it
if you wanna learn how i made it :
just write them written below in the specified area :
in web.config:
<connectionstrings>
<add name="SiteMapConnectionString" connectionstring="Data Source=.;Initial Catalog=Sorular;Integrated Security=True;Pooling=False" providername="System.Data.SqlClient">
<system.web>
<caching>
<sqlcachedependency enabled="true">
<sitemap>
<providers>
<add name="SiteMapBenYazdim" type="SqlSiteMapProvider" connectionstringname="SiteMapConnectionString">
codebehind:
SiteMapDataSource data = new SiteMapDataSource();
data.SiteMapProvider = "SiteMapBenYazdim";
TreeView1.DataSource = data;
TreeNodeBinding bind = new TreeNodeBinding();
bind.TextField = "Title";
bind.ToolTipField = "Description";
bind.ValueField = "Url";
bind.SelectAction = TreeNodeSelectAction.SelectExpand;
TreeView1.DataBindings.Add(bind);
That it man.i have been working on that damn thing about 2 days. And thanks God :-> finally i made it..
|
|
|
|
|
<asp:gridview id="GridView1" allowpaging="True" runat="server"
="" datasourceid="SqlDataSource1" datakeynames="au_id" autogeneratecolumns="False" width="600px" onselectedindexchanged="GridView1_SelectedIndexChanged" onsorted="GridView1_Sorted" onpageindexchanged="GridView1_PageIndexChanged">
<columns>
<asp:commandfield showselectbutton="True">
<asp:boundfield datafield="au_id" headertext="au_id" readonly="True" sortexpression="au_id">
<asp:boundfield datafield="au_lname" headertext="au_lname" sortexpression="au_lname">
<asp:boundfield datafield="au_fname" headertext="au_fname" sortexpression="au_fname">
<asp:boundfield datafield="state" headertext="state" sortexpression="state">
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:pubsConnectionString %>"
="" selectcommand="SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors] WHERE [state] = @state">
<selectparameters>
<asp:controlparameter controlid="DropDownList1" name="state" propertyname="SelectedValue"
="" type="String">
This is haneef.............................................................
|
|
|
|
|
"Select au_id,au_Iname etc. from authors where state = "+Request.QueryString["YourQueryStringKeyName"];
Hope it helps, enjoy.
|
|
|
|
|
|
1. You only have to post the question once.
2. The subject line is for a short description, not for your entire question.
3. If you write your question in the body of the post, you might be able to elaborate enough for someone to actually understand the question.
4. Most of your code seems to be missing. Use the "Ignore HTML" option when posting markup code.
---
single minded; short sighted; long gone;
|
|
|
|
|
<asp:gridview id="GridView1" allowpaging="True" runat="server"
="" datasourceid="SqlDataSource1" datakeynames="au_id" autogeneratecolumns="False" width="600px" onselectedindexchanged="GridView1_SelectedIndexChanged" onsorted="GridView1_Sorted" onpageindexchanged="GridView1_PageIndexChanged">
<columns>
<asp:commandfield showselectbutton="True">
<asp:boundfield datafield="au_id" headertext="au_id" readonly="True" sortexpression="au_id">
<asp:boundfield datafield="au_lname" headertext="au_lname" sortexpression="au_lname">
<asp:boundfield datafield="au_fname" headertext="au_fname" sortexpression="au_fname">
<asp:boundfield datafield="state" headertext="state" sortexpression="state">
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:pubsConnectionString %>"
="" selectcommand="SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors] WHERE [state] = @state">
<selectparameters>
<asp:controlparameter controlid="DropDownList1" name="state" propertyname="SelectedValue"
="" type="String">
This is haneef.............................................................
|
|
|
|