Hi all! I want to create a watermark in Crystal Report like in MS Word but I don't know how. Can you show me how? Thx!
gyokusei
Posts
-
How to create a watermark in Crystal Report? -
Redirect to Word document???if( File.Exists(Server.MapPath("...")) )
{
FileStream MyFileStream;
long FileSize;
MyFileStream = new FileStream(Server.MapPath("..."), FileMode.Open);
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)FileSize);
MyFileStream.Close();
Response.ContentType = "application/msword";
Response.BinaryWrite(Buffer);
}
else
MessageBox.Show("File not found!");This code fragment will ask user download this file. However user can open this file by press open button. Therefore, MSWord will be open. Is there any suggestion?
-
Stored Proceduresdadax_85 wrote:
proc = "EXEC SP1 " & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "'," & TextBox4.Text
very dangerous! using these code instead: [C#]
SqlCommand cmd = new SqlCommand("SP1", con);
cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.Add("@ID", TextBox1.Text);
cmd.Parameters.Add("@Name", TextBox2.Text);
cmd.Parameters.Add("@Decription", TextBox3.Text);
cmd.Parameters.Add("@ProjectID", TextBox4.Text);cmd.ExecuteNonQuery();
-- modified at 21:55 Sunday 23rd April, 2006
-
error in asp.netUsing "try catch" block:
try {
// do something
}
catch( Exception ex ) {
// do something if an error in try block occurs
} -
Extending Try CatchThe flow of try catch block is when your code in try block occurs an error, it will do something in catch block. After that it will do something after catch block. So that:
SqlConnection connection = new SqlConnection( "ConnectionString" );
SqlCommand cmd = new SqlCommand( "CommandText", connection );
try {
connection.Open();
cmd.ExecuteNoneQuery();
}
catch {
// do something
}now you put each line in try block in try catch block like that:
try {
try { connection.Open(); } catch { // do something } try { cmd.ExecuteNoneQuery(); } catch { // do something }
}
catch {
// do something
}Do you understand now?
-
to print datagrid control in asp.net 2k3Hi raj1984, try this: 1. Add a div tag on your page and give it an ID (ex: divGrid) 2. Add your datagrid control into the div. 3. Add an button and write to onclick event, which will open a new blank page. 4. Add all HTML tag in divGrid to the new page. ex:
<div id='divGrid'> <asp:DataGrid.... </div> <input type='button' onclick.='doPrint();'>
doPrint method:function doPrint() { var subwin = window.open("_blank"); // you can open an existing page var d = document.getElementById("divGrid"); subwin.document.write(d.innerHTML); subwin.print(); }
-
Asp.net 2 - show webform as pop up form?Rahman Mahmoodi wrote:
window.open('mywindow','','formname.aspx',height='400',width='400')
window.open('formname.aspx','subwin','height=400,width=400,menubar=no,toolbars=no ,scrollbars=no');
-
Asp.net 2 - show webform as pop up form?Rahman Mahmoodi wrote:
asp:Button ID="Button1" runat="server" Text="Button" "OnClick"="ShowWindow"
<asp:Button ID="Button1" Runat="server" Text="Button"></asp:Button>
on Page_Load:Button1.Attributes["onclick"] = "ShowWindow(); return false;";
That way is used for server control. However, you just add an HTML control is OK. -
Button in datagrid footertry this event handler: OnItemCommand that button must be a server control
-
Wana Change Color of different Links on the same pagetry this:
var i=0; var arr = new Array(); arr[0] = "blue"; arr[0] = "red"; arr[0] = "yellow"; arr[0] = "#000000"; function doClick(link) { link.style.color = arr[i]; i = i%20; // 20 is the link number }
on page:<a href="..." onclick="doClick(this);">link 1</a> <a href="..." onclick="doClick(this);">link 2</a> <a href="..." onclick="doClick(this);">link 3</a> <a href="..." onclick="doClick(this);">link 4</a> ....
Im not sure but something like this. :doh: -
Sending email problem!!!When I send Email using:
SmtpMail.SmtpServer = "..."; // My IP address SmtpMail.Send("webmaster@....", "gyokusei@inbox.com", "This is a test!", "Testing...... Thanks!");
It works fine but the mail message (.EML file) isn't delivered. It stores in Queue folder. I configured the IIS well as MSDN showed. And I can use Outlook 2003 to send an email to webmail(inbox.com) with my IP address. Can you help me solve this problem? -- modified at 0:13 Friday 14th April, 2006 -
How to add an image to web user control?Thank you for your reply! However, GetWebResourceUrl: This method is new in the .NET Framework version 2.0. Now I tell you the detail: I want to write a datetimepicker, it has a textbox and an image at beside. So that I create a web control extended textbox. I don't care about the image of the assembly, I just pay attention to the image beside the textbox. I want when I compile it into dll file, It will be a dependent control. The image beside the textbox doesn't belong to any projects. any suggestion?
-
use view statevipinpaliwal1980 wrote:
1. i am want to know what is viewstate in asp.net.
ViewState is an object use for save the state of server controls in webpage.
vipinpaliwal1980 wrote:
2. how can i use viewstate
vipinpaliwal1980 wrote:
3. how much data take in viewstate
I don't know exactly
-
How to add an image to web user control?Hi all, I created a control extends textbox control and I named it MyTextBox. In render method, I added an image beside the textbox like: <img src='...'>. However, when I apply it to my webpage. The image doesn't appear (The image's url depend on webapplication project). So, I want to ask you how I embed that image in my control (dll file). Thx!
-
How to add multiple attachments dynamically using javascript?Hi all, I want to add multiple attachments dynamically by using javascript. And this is my code:
<div id="attachments">
</div>
function addMore:
function addMore(id)
{
// create the next id
var newid = eval(++id);// create a new fileupload control string s = ""; // add the control above to the form document.getElementByID('attachments').innerHTML += s;
}
It works fine, but the problem is the value of "file_1" is empty after the function addMore called. So that I can't use method: Request.Files (which gets all fileupload controls' values on the form) on server. Any suggestions? Thanks! -- modified at 6:10 Wednesday 5th April, 2006
-
How to validate input?1. set MaxLength property of that textbox to 6 2. drag a RegularExpressionValidator to .aspx page 3. set ControlToValidate property to the id of that textbox. 4. enter an expression to ValidationExpression property like this: (\d){6}
-
Make a tableDataTable tb = new DataTable("TableName"); for( int i=0; i<10; i++ ) { tb.Columns.Add( new DataColumn("ColumnName") ); // ColumnName is also the ID of this column, case-sensitive } for( int j=0; j<10; j++ ) { tb.Rows.Add( tb.NewRow() ); }
how to access to the cell:tb.Rows[rowIndex][columnName]
-
Question about DataGrid -> Headerxoxoxoxoxoxox wrote:
i have to ingore first two lines in my file and make third line header
It means you have a xml file, and you read it to DataTable and after that you want to bind the data in DataTable to the Grid but set the third row to the header of the Grid, isn't it?
-
How to add a meta tag dinamically?Hi everyone! Can you show me how to add a meta tag dinamically?
-
Is there file chooser in Javascript?Vasudevan Deepak Kumar wrote:
Browse button in Inbox.com is for serverside file viewing. It also has a local file browser.
Sorry for disturbing you, but I don't understand what you mean. I mean I want to use a hyperlink to open a file chooser (for more attachment like Gmail). However, as Gmail, I can't view the source of ComposeMail page in InboxMail. You said that it also had a local file browser. Can you show me more detail? Thank you very much!