This question already has answers here:
Windows Forms Graphic Issue on Windows 10 OS
(1 answer)
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 1 year ago.
I am trying to render rdlc in winforms with
Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
I am getting table control alignment issue when rendering
but when printing it is displaying properly
below is the code I am using for render rdlc in winforms
Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
Dim LocalReport = Me.ReportViewer1.LocalReport
LocalReport.Refresh()
LocalReport.ReportPath = Application.StartupPath + "\\MessageReports\\Report2.rdlc"
Dim dsReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
dsReportDataSource.Name = "DataSet1"
dsReportDataSource.Value = dtCancelMessage
LocalReport.DataSources.Add(dsReportDataSource)
Me.ReportViewer1.RefreshReport()
I am using using dotnet framework 4.8
Is this the known issue or am I doing anything wrong
Related
I have a C# windows forms app with a data grid. One column of the grid is an image column which I put a bitmap in. It works fine on the Windows 10 machine I developed it on and when I deploy it on Windows 7 machines, but on all other Windows 10 machines I get an error. The error is "System.FormatException: Formatted value of the cell has a wrong type." I haven't been able to recreate the error on my development machine, so I'm not sure how to figure out what's wrong. I thought it might be occurring because some prerequisite was not included when I deploy it (it's a Click Once application), but I don't see anything missing. I thought maybe it couldn't find the links to the image, so I tried drawing them instead and still got the same error. I'm guessing it has to do with my bitmap column, but I don't know why it would work on my machine and Windows 7 machines and not other Windows 10 machines. Any ideas on what's happening and/or how to fix this?
Here is the designer for my grid:
Here is the DefaultCellStyle settings. I thought the NullValue might be the cause. I originally had System.Drawing.Bitmap in it. I tried using null, but still get an error.
Here's the code for how I populate that column.
Bitmap bmpCombineOnly = new Bitmap(1, 1);
Bitmap bmpYellow = new Bitmap(26, 26);
Graphics grYellow = Graphics.FromImage(bmpYellow);
grYellow.DrawEllipse(new Pen(Color.Yellow, 2), 0, 0, 25, 25);
grYellow.FillEllipse(new SolidBrush(Color.Yellow), 0, 0, 25, 25);
bmpCombineOnly = bmpYellow;
foreach (DataGridViewRow row in ItemsInLocationDataGridView.Rows)
{
row.Cells["Icon"].Value = bmpCombineOnly;
}
This question already has answers here:
Read in file for constants #java
(2 answers)
Closed 4 years ago.
I have javafx application. What i want to do:
When application starts, it reads some file with userConstants (email data, phone data etc) and save it somewhere and uses those constants all time during application working session. So where do i need to store this data? Some special class, or enum? I don't want to read this file every time, when other classes needs those constants.
I hope you understand my question )
public class ConstantsClassName{
public static final String MAXARRAYSIZE;
static{
// read your file and store the data in;
MAXARRAYSIZE = valueRetrievedFromFile;
}
}
Solution found! From here
This question already has answers here:
Best way to convert some C# codes with Lambda Expressions to managed C++\CLI [closed]
How to use LINQ in C++/CLI - in VS 2010/.Net 4.0
(2 answers)
Using C# extension methods from managed C++/CLI
(1 answer)
Closed 6 years ago.
There is a simple managed code in C++\CLI :
cli::array<String^>^ ar= gcnew cli::array<String^>{"Stack","Over","Flow", "Over" };
Now i want to sort this array using with LINQ.
How use LINQ in C++\CLI managed codes?
In regular .net & c# language programming way we act like this :
string[] ar = new string[] {"Stack","Over","Flow", "Over" };
string[] ar_sort = ar.OrderByDescending(s => s).ToArray();
int count = ar_sort.Where(s => s.Contains("Over")).Count();
Now i want convert them to C++\CLI managed :
cli::array<String^>^ ar= gcnew cli::array<String^>{"Stack","Over","Flow", "Over" };
... What about this line????
... And What about this line????
Based on this link :
How to use LINQ in C++/CLI - in VS 2010/.Net 4.0
C++/CLI does not support LINQ syntax.
But this link is for 2011 year & related to VS 2010.
My VS version is 2015.
So This Question is not duplicate.
Please don't vote to close.
I downloaded the pdf from the below link
http://ap.meeseva.gov.in/DeptPortal/Application%20Forms%20New/Revenue-pdf/Income%20General%20Application%20Form.pdf
What I need is I would like to fill out the blanks with the given text, I tried with the following code
using (FileStream outFile = new FileStream(#"E:\\residence(VRO)1.pdf", FileMode.Create))
{
PdfReader pdfReader = new PdfReader(#"E:\\residence(VRO).pdf");
PdfStamper pdfStamper = new PdfStamper(pdfReader, outFile);
pdfStamper.FormFlattening = true;
AcroFields af = pdfReader.AcroFields;
string[] fields = pdfStamper.AcroFields.Fields.Select(x => x.Key).ToArray();
for (int key = 0; key <= fields.Count() - 1; key++)
{
}
}
But I am not getting the fields so can some one help me
The so-called form you refer to, isn't a form. That is: it's not an interactive form. I took that PDF and I added interactive fields. Please download adapted.pdf and examine it to discover the differences.
Now when you run your code on it, you'll see the fields, and you will be able to fill out the form with Western text. You are currently using iTextSharp 5 or earlier. That version of iText doesn't support Hindi. Hindi wasn't introduced up until iText 7. Hence if you want to fill out the form using an Indic writing system (Devanagari, Tamil,...), you need iText 7 for C# and the pdfCalligraph add-on. Note that the pdfCalligraph add-on is kept closed source. You need a commercial license to use it.
We kept that part closed source because:
Too many companies are using iText without respecting the AGPL license and without purchasing a license,
As far as I know, no other free software supports Indic writing systems. We'd be giving away too much value if we released pdfCalligraph as open source software.
Summarized:
your form is not a form. Make it a form.
use software that can fill out such a form using an Indic writing system (e.g. iText 7 + the pdfCalligraph add-on).
I created report(XtraReport) and i drag reporting tool PrintBarManager or PrintControl to form. Now I need to load that report to that PrintControl. How to load ? Help me.
I tried this code but showing error - Object reference is not set to instance of object
var test = new XtraReport1();
printControl1.Container.Add(test); // Object reference not set to instance of object
test.ShowPreview();
I tried this code but it showing - Best overloaded method match.....
var test = new XtraReport1();
printControl1.Controls.Add(test); // Best overloaded method, invalid arguments
test.ShowPreview();
How to load my report to PrintControl ?
Use the following code:
//Set the printing system
printControl.PrintingSystem = report.PrintingSystem;
//Create and build your report
XtraReport1 report = new XtraReport1();
report.CreateDocument();
P.S. Take a look at How to: Add a Print Preview to a Windows Forms Application guidance.