15,908,661 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Thakur JAI SINGH (Top 15 by date)
Thakur JAI SINGH
31-Dec-15 8:58am
View
@Kendokumar I am not able to understand what change have you suggested...?
Thakur JAI SINGH
31-Dec-15 7:06am
View
@Jochen Arndt Thanks for the reply
I have done the changes as suggested by you but still unable to get the exact result.
Thakur JAI SINGH
31-Dec-15 7:04am
View
@Richard MacCutchan
The error code value returned by the StgOpenStorageEx is 2147500034.
I dont understand what does it mean
Thakur JAI SINGH
21-Dec-15 5:25am
View
Thanks I have updated the code.
Thakur JAI SINGH
17-Dec-15 3:45am
View
@PJ Arends I have gone through that link but still unable to find the solution
Same code I is running on VS2012 but it giving error on VS2015 ..
I also searched for mfc110.lib this file is present on Visual studio 2011
I am wondering when this file is not present in VS2012 why its not giving error..
My code is running successfully in VS2012
Thakur JAI SINGH
20-Jul-15 4:28am
View
@Richard MacCutchan I want to restrict user for just one folder.... not all folder
Thakur JAI SINGH
20-Jul-15 4:26am
View
@Mukesh Pr@sad I can do that but I want to do it programatically.
Thakur JAI SINGH
15-Jun-15 6:37am
View
Deleted
@BNotr I am using the following code it creates Hyperlink and add it to the given location its giving error "Reference not valid"
//Code Snippet
private void AddHyperLink(Workbook xlWorkBook,int nfaultCount)
{
Excel.Worksheet xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
DateTime now = DateTime.Now;
xlWorkSheet.Name = "Summary";
xlWorkSheet.Cells[3, 2] = "SnapShot Details";
xlWorkSheet.Cells[3,2].EntireRow.Font.Bold = true;
xlWorkSheet.Range[xlWorkSheet.Cells[3, 1], xlWorkSheet.Cells[3, 2]].Merge(); //code to merge cells
xlWorkSheet.Select(Type.Missing);
xlWorkSheet.Cells[6, 1] = "Snapshot taken at";
xlWorkSheet.Cells[6, 2] = now;
xlWorkSheet.Cells[8, 1] = "Click on the Hyperlinks below to navigate to the corresponding sheet";
xlWorkSheet.Range[xlWorkSheet.Cells[8, 1], xlWorkSheet.Cells[8, 6]].Merge(); //code to merge the cells
xlWorkSheet.Cells[8, 1].EntireRow.Font.Bold = true;
for (int i = 1; i <= nfaultCount; i++)
{
int x = i + 9;
string str = "Fault Code "+i + " of " + nfaultCount; //Test link as
string strRange1 = "A" + x;
string strRange2 = "A" + x;
string strRange = strRange1 + ":" + strRange2; //Location of link
var Range = xlWorkSheet.get_Range(strRange);
// strRange1 = "!" + strRange1;
// i+" of "+nfaultCount name of target worksheet
string strp="#" + i + " of " +nfaultCount + strRange1;
Range.Cells.Hyperlinks.Add(Range,strp, Type.Missing, "Fault Code Link", str);
}
xlWorkSheet.Columns["A:B"].AutoFit();
}
Kindly help me out
Thakur JAI SINGH
15-Jun-15 6:05am
View
Deleted
@BNotr I am able to add reference but when I click on the link it gives error refrence not valid.
Thakur JAI SINGH
9-Jun-15 5:05am
View
@Sergey Alexandrovich Kryukov
so what is the solution?
Thakur JAI SINGH
8-Jun-15 14:10pm
View
@OriginalGriff
,Fault Information
,Fault Code,1434,
,Fault Descrption,Remote E-Stop Activated,
,Time Stamp,02/19/2015 02:20:00,
,Occurence Count,4,,
,Battle Short Status,Inactive,,,
Parameter Information
,Parameter Name,Parameter Value,Unit
,Controller Mode,Ready,
,Battery Voltage,17.315,Vdc
,Genset Run Sequence State,Stop,
,Genset Run Command,Emergency Stop,
,Genset Run Type,Emergency Remote Start,
,Coolant Temperature,Not Available,degF
,Oil Pressure,Not Available,psi
,Aftercooler Temperature,Not Available,degF
,Intake Manifold Pressure 1,Not Available,psi
,Genset % Application Total kW,0.0,%
,Genset L1 Power Factor,1.00,PF
,Genset L2 Power Factor,1.00,PF
,Genset L3 Power Factor,1.00,PF
,Genset Total kVA,0,kVA
,Genset Total kVAR,0,kVAR
,Genset Frequency,0.000,Hz
,AVR PWM Command,0.00,%
,Genset L1L2 Voltage%,0.00,%
,Genset L2L3 Voltage%,7.99,%
,Genset L3L1 Voltage%,7.99,%
,Genset % Application L1 Current,0.0,%
,Genset % Application L2 Current,0.0,%
,Genset % Application L3 Current,0.0,%
,Genset Total Power Factor,1.00,PF
,Load Dump Command,Inactive,
,ES State,Standby,
,Genset Bus Frequency,0.000,Hz
,Genset CB Position Status,Not Available,
,Utility CB Position Status,Not Available,
,Paralleling Voltage Ref Offset,0.00,%
,Paralleling Frequency Ref Offset,0.000,Hz
,Derated Target kW,100.00,%
,Load Govern kW Ramp State,Not Applicable,
,Load Share Ramp State,Not In Load Share,
,Load Govern kW Target,0.00,%
,Load Govern kVAR Target,0.00,%
I am passing this inside the list and want to convert it into datatable.
each new line increments the counter by one in list.
and why did you use dataGridView1.DataSource = dt;?
what is the use of dataGridView?
Thakur JAI SINGH
8-Jun-15 10:40am
View
@Maciej Los .net framework 4.5
Thakur JAI SINGH
5-Jun-15 6:23am
View
@OriginalGriff
Below is the code for list that I have created
//code to read all lines from a csv file
var lines = File.ReadAllLines(Global_Class.Args0Path + "\\" + Global_Class.Args1Filename + ".csv");
int nLine = 0;
string strMultiSheetFile = null;
foreach (string line in lines)
{
if (line.Contains("Fault Information"))
{
nFaultCount++;
if (nFaultCount == 1)
{
int counter = 0;
strMultiSheetFile=strMultiSheetFile+line;
foreach (string strline in lines)
{
if (strline.Contains("Fault Information"))
{
counter++;
continue;
}
else
{
if (counter == 2)
break;
strMultiSheetFile = strMultiSheetFile + strline;
}
}
list.Add(strMultiSheetFile);
}
else
{
list.Add(strMultiSheetFile);
strMultiSheetFile = null;
}
}
else
{
strMultiSheetFile = strMultiSheetFile + line;
}
nLine++;
}
Thakur JAI SINGH
5-Jun-15 6:17am
View
//code to read all lines from a csv file
var lines = File.ReadAllLines(Global_Class.Args0Path + "\\" + Global_Class.Args1Filename + ".csv");
int nLine = 0;
string strMultiSheetFile = null;
foreach (string line in lines)
{
if (line.Contains("Fault Information"))
{
nFaultCount++;
if (nFaultCount == 1)
{
int counter = 0;
strMultiSheetFile=strMultiSheetFile+line;
foreach (string strline in lines)
{
if (strline.Contains("Fault Information"))
{
counter++;
continue;
}
else
{
if (counter == 2)
break;
strMultiSheetFile = strMultiSheetFile + strline;
}
}
list.Add(strMultiSheetFile);
}
else
{
list.Add(strMultiSheetFile);
strMultiSheetFile = null;
}
}
else
{
strMultiSheetFile = strMultiSheetFile + line;
}
nLine++;
}
I read all lines of a csv file and using using that lines on some condition I have prepared a list which is having list count.
Now I want to fill each list item in a different excel sheet.
Thakur JAI SINGH
3-Jun-15 8:28am
View
@OriginalGriff
My problem is I am not able to create multiple sheets at runtime and write the data in to it.
I have tried the following code
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Workbook doc;
doc = excelApp.Workbooks.Open(Global_Class.Args0Path + "\\" + Global_Class.Args1Filename + "_Report.csv", false, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value);
doc.SaveAs(Global_Class.Args0Path + "\\" + Global_Class.Args1Filename + Global_Class.ReportExcelFileExtention/*"_Report.xlsx"*/, Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbook, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, XlSaveAsAccessMode.xlExclusive, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
ForMat_SnapShotReport(doc);
excelApp.Visible = true;
Show More