How to add Hyperlink in DWB Number
str = @"SELECT[DWB No],(SELECT GPS_LINK FROM CT_CCP_VEHICLE_TRACKING T WHERE R.Vehicle_No=T.VEHICLENO) as [Live GPS],[DWB Date], Origin, Destination, [Consignor Name], [Consignee Name], [Invoice No], [Part Number], [Part Name], Quantity, Packages, Weight, CBM, [Invoice Date], [Ewaybill No], [Ewaybill Valid Upto], [Current Location], [Dispatch Date], Vehicle_No, ASN, ETA, [GRN Number], [Actual Repoting Date], [Reach Days], [Transit Days], Status, [LIVE Location], [Status Updated On]
FROM [CCP_PLANT_MIS_VW] R WHERE R.Destination ='" + obj.Plant_Code.Trim() + "' ";
DataSet br = oper.DTSET(str);
for (int k = 0; k < br.Tables.Count; k++)
{
//str = "SELECT GPS_LINK FROM CT_CCP_VEHICLE_TRACKING WHERE VEHICLENO='" + br.Tables[0].Rows[k][18].ToString() + "'";
//DataSet Gps = new DataSet();
//Gps = oper.DTSET(str);
//if (Gps.Tables[0].Rows.Count >= 1)
//{
// GPSLink = Gps.Tables[0].Rows[0]["GPS_LINK"].ToString();
//}
//Gps.Clear();
var ws = workbook.Worksheets.Add(br.Tables[k], SheetName);
ws.Row(1).InsertRowsAbove(3);
var table = ws.Tables.First();
ws.Columns().AdjustToContents();
ws.CellsUsed().Style.Font.FontName = "Calisto MT";
ws.CellsUsed().Style.Font.FontSize = 10;
table.ShowHeaderRow = true;
table.ShowAutoFilter = true;
ws.Cell("A1").Value = "Plant Mis Report : " + obj.PLANT_NAME + " ";
var range = ws.Range("A1:AB1");
ws.Cell("A1").Style.Font.FontName = "Castellar";
ws.Cell("A1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
range.Merge().Style.Font.SetBold().Font.FontSize = 10;
ws.Cell("A2").Value = "Report Generate Date : " + System.DateTime.Now.ToString("dd-MMM-yyyy hh:mm tt") + "";
var range1 = ws.Range("A2:AB2");
ws.Cell("A2").Style.Font.FontName = "Century";
ws.Cell("A2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
range1.Merge().Style.Font.SetBold().Font.FontSize = 7;
ws.CellsUsed().Style.Font.FontName = "Calisto MT";
ws.CellsUsed().Style.Font.FontSize = 10;
var range3 = ws.Range("A4:AB4");
range3.Style.Fill.BackgroundColor = XLColor.SlateGray;
range3.Style.Font.FontColor = XLColor.White;
range3.Style.Font.Bold = true;
// ws.Cell("A4").SetFormulaA1(@"=HYPERLINK(" + br.Tables[0].Rows[k][0].ToString() + "," + br.Tables[0].Rows[k][1].ToString() + ")");
// ws.Cell("A4").Value=(@"=HYPERLINK(" + br.Tables[0].Rows[k][0].ToString() + "," + br.Tables[0].Rows[k][1].ToString() + @")");
}
string subject = "CCP:-" + obj.PLANT_NAME + " Plant MIS Report";
workbook.SaveAs(folderPath + obj.Plant_Code + "_Plant_MisReport.xlsx");