> Click on theme
>Click on Customize
>Click on advance
>Select tabs from dropdown list
> And you can change font size, font , background
>and click on save
Also you can change font size and font of other gadgets
> Click on theme
>Click on Customize
>Click on advance
>Select tabs from dropdown list
> And you can change font size, font , background
>and click on save
Also you can change font size and font of other gadgets
First you have to download itextsharp.dll and itextsharp.pdfa.dll files and you have to give the font size as below because in some case it will give error that font size is small.
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div id="mainDiv" runat="server">
<asp:Label runat="server" Text="Test" Font-Bold="true" Font-Size="13px" />
<br />
<asp:Label runat="server" Text="E-Admit Card" Font-Bold="true" Font-Size="13px" />
<br />
<table border="1">
<tr>
<td>
<asp:Label runat="server" Text="Date Of Test:" Font-Size="13px" />
</td>
<td>
<asp:Label runat="server" Text="20/11/2024" Font-Size="13px" />
</td>
</tr>
</table>
</div>
<asp:Button ID="Button1" runat="server" Text="Print" OnClick="Button1_Click" />
</form>
===========================
protected void Button1_Click(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=Panel.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
mainDiv.RenderControl(htmlTextWriter);
StringReader stringReader = new StringReader(stringWriter.ToString());
Document Doc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
HTMLWorker htmlparser = new HTMLWorker(Doc);
PdfWriter.GetInstance(Doc, Response.OutputStream);
Doc.Open();
htmlparser.Parse(stringReader);
Doc.Close();
Response.Write(Doc);
Response.End();
}
Convert nupkg file to zip file and you will get dll files in it.
On the right hand side of nuget website you will get "download package" option.
using System;
using System.Data.SqlClient;
public class SqlPrintExample
{
public static void Main(string[] args)
{
string connectionString = "Data Source=YourServer;Initial Catalog=YourDatabase;Integrated Security=True";
string sqlQuery = "PRINT 'This message comes from SQL.'; SELECT GETDATE() AS CurrentDateTime;";
using (SqlConnection connection = new SqlConnection(connectionString))
{
// Attach an event handler to capture InfoMessage events (including PRINT statements)
connection.InfoMessage += Connection_InfoMessage;
or// conn.InfoMessage += new SqlInfoMessageEventHandler( Connection_InfoMessage);
try
{
connection.Open();
using (SqlCommand command = new SqlCommand(sqlQuery, connection))
{
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine($"Current Date Time from SQL: {reader["CurrentDateTime"]}");
}
}
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
private static void Connection_InfoMessage(object sender, SqlInfoMessageEventArgs e)
{
// Display the message from the SQL PRINT statement
Console.WriteLine($"SQL InfoMessage: {e.Message}");
}
}
For data looping in sql Server, we use While loop or cursor
DECLARE @cnt INT = 0;
WHILE @cnt < 10
BEGIN
PRINT 'Inside simulated FOR LOOP on TechOnTheNet.com';
SET @cnt = @cnt + 1;
END;
PRINT 'Done simulated FOR LOOP on TechOnTheNet.com';
GO
For cursor:-
https://www.c-sharpcorner.com/blogs/how-to-use-cursors-and-while-loop-in-sql-server