|
Sorry. That portion may not have copied into the post.
The input for the program would be the string from a field in the report in MS Access.
The program takes the string and uses the QR Coder Nugent Package to create a QR code image.
The program will output the QR code image as the object that is printed in the report.
|
|
|
|
|
There is no clear reason why you think you need "ActiveX" in this scenario.
C# can read MS Access; create the QR image; and store / print "it".
The "Access report with the QR (string)" is some byproduct of Access.
Connect to data in an Access database - Visual Studio | Microsoft Docs
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Yes. I found an example of what your talking about here. Good suggestion. Thanks.
|
|
|
|
|
Hello Everyone!
I am C#/ASP.NET new learning
And my english is very bad (I am Taiwanese)
My Boss give me a .NET test
the problem is like say : Use swtich(expr) expression can action on byte?, long?, String?
My answer is
byte => OK, long => unknow, String => OK
But my boss give me answer is
switch(expr) expression need is integer type / integer expression
Os long and string is not use on switch
After I fund answer in internet like
Switch Statement in C# - GeeksforGeeks
The first paragraph: The switch expression is of integer type such as int, char, byte, or short, or of an enumeration type, or of string type
Can someone talk me true answer?!
I vary appreciate, thank your
*I can not ask on Chinese Webpage beacuse i afraid my boss see this
|
|
|
|
|
it's possible your boss is using the wrong words: there are two types of switch in c# And he may be getting confused.
Strings, integers of all forms (including long), chars, enums are all legal in C# switch statements: C# switch statement | Microsoft Docs[^]
With switch expressions, the range is even bigger: switch expression - C# reference | Microsoft Docs[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
thank your reply
I guess boss get c/c++ test not .NET/C# test
Unfortunately my test is failed
|
|
|
|
|
I guess if he's saying something that is untrue, create a project and show him you can switch on almost anything? That was a major step forward, he's thinking of C++ I reckon
|
|
|
|
|
thank your reply
Unfortunately i can not do this
(i mean => create a project and show him you can switch on almost anything...)
I am new for C#/.Net so i can not refute my boss
Right concept is very important for learning
And thanks you talk me the right answer
|
|
|
|
|
That's just not how sh*t works. If you don't know C# well enough to show your boss he is wrong, you are in a world of trouble. You clearly should not have a boss who pays you to write code right now. You should leave this awful job, enrol in a course, and learn C#.
|
|
|
|
|
I know your meaning, and thanks your recommend
originally I am PHP engineer(almost 1 year), not C#/.Net engineer
But my boss want to use C# development
Os now I need use PHP and C# at same time/job
don't worry about trouble(
you are in a world of trouble )
My boss is not first time do this(give me inappropriate information)
And thank you
|
|
|
|
|
I cannot remember but it seems like a language I used in the past only allowed switches on integers. Christian implies that C++ is that way so my guess is your boss is not aware that most languages do allow switch on other types.
|
|
|
|
|
thank your reply
I just found c/c++/java on network for this problem
I not found any answer for c#/.Net
Now I feel confused about this test
|
|
|
|
|
Upin L wrote: confused Why? Most all programming languages allow switching on various data types.
|
|
|
|
|
Hi,
I am developing a Work Load Analysis platform and there I use System.Windows.Forms.DataVisualization.Charting. The problem i have is, Xaxis is not updated when switching between different value types in runtime.
Here is the code, which i use to update chart from DateTime valuetype to int.
Here _EndWeek and _StartWeek are integer parameters pass to this method.
List<int> _Weeks = new List<int>();
int _Week_Difference = _EndWeek - _StartWeek;
for (int i = 0; i <= _Week_Difference; i++)
{
_Weeks.Add(_StartWeek+ i);
}
chart_Utilization.Series[0].Points.Clear();
chart_Utilization.Series[1].Points.Clear();
chart_Utilization.Series[2].Points.Clear();
chart_Utilization.Series[0].XValueType = ChartValueType.Int32;
chart_Utilization.Series[1].XValueType = ChartValueType.Int32;
chart_Utilization.Series[2].XValueType = ChartValueType.Int32;
chart_Utilization.ChartAreas[0].AxisX.Interval = 1;
chart_Utilization.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Number;
chart_Utilization.ChartAreas[0].AxisX.IntervalOffsetType = DateTimeIntervalType.Number;
chart_Utilization.ChartAreas[0].AxisX.LabelStyle.Format = "{0:0}";
chart_Utilization.ChartAreas[0].AxisX.Minimum = 1;
chart_Utilization.ChartAreas[0].AxisX.Maximum = 53;
chart_Utilization.Update();
I would be glad, if some could help me in this case.
|
|
|
|
|
You cleared all your points; I don't see you adding any back in.
chart_Utilization.Series[0].Points.Clear();
chart_Utilization.Series[1].Points.Clear();
chart_Utilization.Series[2].Points.Clear();
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
The data is added in a loop after this piece of code. Data is added, but the X-Axis labelling is wrong. They are still in Datetime format.
|
|
|
|
|
The x-axis usually is "time" in a time-series. You've provided no new information.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I want to change the XAxis Value type to Int. How can i change it in runtime?
Because, the XAxis value type is dynamically changed according to the filter inputs from the user.
|
|
|
|
|
|
Thanks a lot for your reply. I created sample application with same code here for your reference.
This method is called when form is loaded.
private void Format_Chart()
{
ChartArea _Area = new ChartArea("Utilization");
_Area.AlignmentOrientation = AreaAlignmentOrientations.Vertical;
_Area.AlignmentStyle = AreaAlignmentStyles.All;
chart_Utilization.ChartAreas.Add(_Area);
chart_Utilization.ChartAreas["Utilization"].Position = new ElementPosition(0, 10, 100, 90);
chart_Utilization.Series.Clear();
Series _Series_Current_Utilization = new Series("Current Utilization");
_Series_Current_Utilization.ChartArea = _Area.Name;
_Series_Current_Utilization.XValueType = ChartValueType.Date;
_Series_Current_Utilization.YValueType = ChartValueType.Double;
_Series_Current_Utilization.YValuesPerPoint = 1;
_Series_Current_Utilization.ChartType = SeriesChartType.StackedColumn;
_Series_Current_Utilization.Color = Color.FromArgb(200, 20, 191, 154);
Series _Series_Over_Utilization = new Series("Over Utilization");
_Series_Over_Utilization.ChartArea = _Area.Name;
_Series_Over_Utilization.XValueType = ChartValueType.Date;
_Series_Over_Utilization.YValueType = ChartValueType.Double;
_Series_Over_Utilization.YValuesPerPoint = 1;
_Series_Over_Utilization.ChartType = SeriesChartType.StackedColumn;
_Series_Over_Utilization.Color = Color.Red;
Series _Series_Target_Utilization = new Series("Target Utilization");
_Series_Target_Utilization.ChartArea = _Area.Name;
_Series_Target_Utilization.XValueType = ChartValueType.Date;
_Series_Target_Utilization.YValueType = ChartValueType.Double;
_Series_Target_Utilization.YValuesPerPoint = 1;
_Series_Target_Utilization.ChartType = SeriesChartType.Line;
_Series_Target_Utilization.Color = Color.FromArgb(200, 20, 191, 154);
chart_Utilization.Series.Add(_Series_Current_Utilization);
chart_Utilization.Series.Add(_Series_Over_Utilization);
chart_Utilization.Series.Add(_Series_Target_Utilization);
chart_Utilization.Legends[_Series_Current_Utilization.Legend].Docking = Docking.Top;
chart_Utilization.Legends[_Series_Current_Utilization.Legend].Alignment = StringAlignment.Center;
chart_Utilization.Legends[_Series_Target_Utilization.Legend].Docking = Docking.Top;
chart_Utilization.Legends[_Series_Target_Utilization.Legend].Alignment = StringAlignment.Center;
chart_Utilization.Legends[_Series_Over_Utilization.Legend].Docking = Docking.Top;
chart_Utilization.Legends[_Series_Over_Utilization.Legend].Alignment = StringAlignment.Center;
chart_Utilization.ChartAreas[0].AxisX.LabelStyle.Format = "yyyy-MM-dd";
chart_Utilization.ChartAreas[0].AxisX.Interval = 1;
chart_Utilization.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Days;
chart_Utilization.ChartAreas[0].AxisX.IntervalOffset = 1;
chart_Utilization.ChartAreas[0].AxisY.Maximum = (double)(120);
chart_Utilization.ChartAreas[0].AxisY.Minimum = (double)(0);
}
There are two button click events to change the value type of XAxis.
1. To change to ChartValueType.Date
private void btnDates_Click(object sender, EventArgs e)
{
List<double> _Values = new List<double>();
int _Count = 1;
for(int i = 0; i < 10; i++)
{
_Values.Add(i * 2.5d);
}
chart_Utilization.Series["Current Utilization"].Points.Clear();
chart_Utilization.Series["Over Utilization"].Points.Clear();
chart_Utilization.Series["Target Utilization"].Points.Clear();
chart_Utilization.Series["Current Utilization"].XValueType = ChartValueType.Date;
chart_Utilization.Series["Over Utilization"].XValueType = ChartValueType.Date;
chart_Utilization.Series["Target Utilization"].XValueType = ChartValueType.Date;
chart_Utilization.ChartAreas[0].AxisX.Interval = 1;
chart_Utilization.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Days;
chart_Utilization.ChartAreas[0].AxisX.IntervalOffset = 1;
foreach(double _dval in _Values)
{
var _point_current = new DataPoint(chart_Utilization.Series["Current Utilization"]);
var _point_target = new DataPoint(chart_Utilization.Series["Target Utilization"]);
var _point_over = new DataPoint(chart_Utilization.Series["Over Utilization"]);
_point_current.SetValueXY(new DateTime(DateTime.Now.Year, DateTime.Now.Month, _Count), _dval);
_point_target.SetValueXY(new DateTime(DateTime.Now.Year, DateTime.Now.Month, _Count), _dval);
_point_over.SetValueXY(new DateTime(DateTime.Now.Year, DateTime.Now.Month, _Count), _dval);
chart_Utilization.Series["Current Utilization"].Points.Add(_point_current);
chart_Utilization.Series["Target Utilization"].Points.Add(_point_target);
chart_Utilization.Series["Over Utilization"].Points.Add(_point_over);
_Count++;
}
}
2. To change to ChartValue type to Int
private void btnInt_Click(object sender, EventArgs e)
{
List<double> _Values = new List<double>();
int _Count = 1;
for (int i = 0; i < 10; i++)
{
_Values.Add(i * 5d);
}
chart_Utilization.Series[0].Points.Clear();
chart_Utilization.Series[1].Points.Clear();
chart_Utilization.Series[2].Points.Clear();
chart_Utilization.Series[0].XValueType = ChartValueType.Int32;
chart_Utilization.Series[1].XValueType = ChartValueType.Int32;
chart_Utilization.Series[2].XValueType = ChartValueType.Int32;
chart_Utilization.ChartAreas[0].AxisX.Interval = 1;
chart_Utilization.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.NotSet;
chart_Utilization.ChartAreas[0].AxisX.IntervalOffsetType = DateTimeIntervalType.NotSet;
chart_Utilization.ChartAreas[0].AxisX.LabelStyle.Format = "{0:0}";
chart_Utilization.ChartAreas[0].AxisX.Minimum = 1;
chart_Utilization.ChartAreas[0].AxisX.Maximum = 53;
chart_Utilization.Update();
foreach (double _dval in _Values)
{
var _point_current = new DataPoint(chart_Utilization.Series["Current Utilization"]);
var _point_target = new DataPoint(chart_Utilization.Series["Target Utilization"]);
var _point_over = new DataPoint(chart_Utilization.Series["Over Utilization"]);
_point_current.SetValueXY(_Count, _dval);
_point_target.SetValueXY(_Count, _dval);
_point_over.SetValueXY(_Count, _dval);
chart_Utilization.Series["Current Utilization"].Points.AddXY(_Count, _dval);
chart_Utilization.Series["Target Utilization"].Points.AddXY(_Count, _dval);
chart_Utilization.Series["Over Utilization"].Points.AddXY(_Count, _dval);
_Count++;
}
}
When i switch from Date to Int, the XAxis labelling still apears as DateTime value type. This is my issue.
Please let me know in which way i can solve this issue.
|
|
|
|
|
I solved the problem by myself.
It is by setting IsXValueIndexed = true for each series allocated for the chart area.
|
|
|
|
|
|
I want to load an Excel file which contains my data, then create pivot table and pivot chart based on that file. Is there any library (free one) that can do this without limitation?
|
|
|
|
|
|
How to change data by using a removable disk in C Sharp language
|
|
|
|