|
hi , i have a little problem here , i have a datagridview that has a plenty of rows and all of that rows are filling with persian words like ("مثلا یه چیزی") , when i'm trying to print this datagridview using printPreviewDialog + print document , it show me the words in wrong spelling . that mean if im seen this word ("محمد") in datagridview it'll print it like this one ("دمحم").
it print it inverse . i have used itextsharp and it also dosnt support persian language .
so any idea ?
|
|
|
|
|
mohammadkaab wrote: it print it inverse
Inverse? You mean from right to left? Most of us can't read Arabic, might be handy to have an English example.
Could you try the setting the RightToLeft[^] property and see if it helps?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
It is printing in reverse the OP's example, "Muhammed" is doing the equivalent of:
"mhmd" is displaying as "dmhd"
I've left the vowels out in the above, as these are written as diacritic marks over/under the main characters for [short] vowels and are customarily left out for most texts. The irony is, I can't speak any other European languages except some schoolboy French and German. Oh and some words in Norwegian, Danish and Dutch are the same as the dialect of English that I speak.
|
|
|
|
|
Keith Barrow wrote: "mhmd" is displaying as "dmhd"
..and where did that extra 'd' come from? Too busy making a point to be correct, are we?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Have you set the RightToLeft property to true? IIRC you will get exactly the problems you describe (the letters being displayed in the reverse order) if you don't. If you can, set the property in the designer, not code.
I'm not sure about the print dialog, the RTL support in winforms is pretty poor.
|
|
|
|
|
couple hours ago , i had download the Spire.DataExport components , it work fine ,but i have a littile problem init , when i want to show my datatable Rows in Pdf it Show It Like this ???? like qustion mark , why ?
the language im using is persian and it's very close to Arabic language , the words is sth like this ("محمد کعب") and it show it like this ("???? ???").
even i have set the property of encoding to UTF8 but nothing happend , just gave me a strange words like this (Ù…ØÙ…).
|
|
|
|
|
You might be having a problem with two different encoding standards. Windows uses a standard for Arabic called Windows-1256. Farsi might be in the same standard. When it is displayed as UTF8 it displays as you describe, with accented characters. You'll need to either encode as UTF8 from Windows 1256 or just set the encoding to windows 1256.
You can see what I mean a bit better here http://forums.digitalpoint.com/showthread.php?t=537748[^]
|
|
|
|
|
I try to find a solution from many places, but not yet solved...and hence I have a
different issue for update dbf file [free table -vfp] from C# OleDbDataAdapter.
string MyConStr = "Provider=VFPOLEDB.1; Data Source='C:\\Temp'; Persist Security Info=False";
VFPDAp = new OleDbDataAdapter();
VFPDAp.InsertCommand = new OleDbCommand();
VFPDAp.UpdateCommand = new OleDbCommand();
VFPDAp.InsertCommand.CommandText = "insert into my_table1 (my_time,reminder) values(?, ?, ?)";
VFPDAp.UpdateCommand.CommandText = "update my_table1 set my_time=?, reminder=? where sl_no=? ";
VFPDAp.InsertCommand.Connection = OleCon1;
VFPDAp.UpdateCommand.Connection = OleCon1;
OleDbParameter Par1 = new OleDbParameter("my_time", -1);
Par1.DbType = DbType.String;
Par1.SourceColumn = "my_time";
Par1.ParameterName = "my_time";
OleDbParameter Par2 = new OleDbParameter("reminder", -1);
Par2.DbType = DbType.String;
Par2.SourceColumn = "reminder"; Par2.ParameterName = "reminder";
OleDbParameter Par3 = new OleDbParameter("my_time", -1);
Par3.DbType = DbType.String;
Par3.SourceColumn = "my_time";
Par3.ParameterName = "my_time";
OleDbParameter Par4 = new OleDbParameter("reminder", -1);
Par4.DbType = DbType.String;
Par4.SourceColumn = "reminder";
Par4.ParameterName = "reminder";
VFPDAp.InsertCommand.Parameters.Add(Par1);
VFPDAp.InsertCommand.Parameters.Add(Par2);
VFPDAp.UpdateCommand.Parameters.Add(Par3);
VFPDAp.UpdateCommand.Parameters.Add(Par4);
OleCon1.ConnectionString = MyConStr;
OleCon1.Open();
VFPDAp.Update(VfpTbl);
OleCon1.Close();
Thanks For The Helps
|
|
|
|
|
Your update-command has three question marks (parameters), yet you assign only two. s1_no isn't added, and will be required.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks Eddy.
While posting time unchecked, but my original code is
VFPDAp.InsertCommand.CommandText = "insert into my_table1 (my_time,reminder) values(?, ?)";
VFPDAp.UpdateCommand.CommandText = "update my_table1 set my_time=?, reminder=? where reminder=? ";
But showing the same error,
SQL: Column 'Q0P2' is not found
Thanks Again
|
|
|
|
|
Paramu1973 wrote: "update my_table1 set my_time=?, reminder=? where reminder=? ";
Same answer still; you have 3 question-marks in there. That means that a IDbCommand will expect three parameters. It will fail if you only supply 2. From the previous code, it looks as if the primary key is missing.
"Which" record would the statement update? You'll either have to remove the condition (in which case "ALL" records will be updated, which is prolly false) or supply the third parameter.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Eddy,
Thanks.......you cleared my 1 1/2 days headache...
Thousands of thanks to you....
Really, I become very upset because of that crazy error...
Thanks Again
|
|
|
|
|
Glad I could help a bit 
|
|
|
|
|
The other day I have asked a question about a program which sits in a place where images come and once its started, function is that it updates when a new image is added, I have found a relevant code for this but I would like to know that would this do the desired task which I require. Appreciate any assistance.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Foundation;
using System.IO;
using System.Data.SqlClient;
using System.Data;
using System.Threading;
using WindowsFormsApplication1;
namespace HotFolderLoader
{
class Program
{
//private BaseFuncs theBaseFuncs = new BaseFuncs();
static void Main(string[] args)
{
string tt = System.Environment.MachineName;
Foundation.BaseFuncs theFoundation = new BaseFuncs();
if (tt == "NEO") //devel
{
//Foundation.getConstr.initialize("Data Source=neo\\neosqlserver;Initial Catalog=nmcvisualdb;Persist Security Info=True;User ID=sa;Password=xxxxxx");
Foundation.getConstr.initialize("Data Source=xx.xxx.xxx.xxx\\bcwebsql;Initial Catalog=nmcvisualdb;Persist Security Info=True;User ID=sa;Password=mr2BCweb");
//Foundation.getConstr.initialize("Data Source=xxx.xx.xxx.xxx\\nmcsql;Initial Catalog=nmcvisualdb;Persist Security Info=True;User ID=sa;Password=xxxxx");
}
else
{
Foundation.getConstr.initialize("Data Source=xx.xxx.xxx.xxx\\bcwebsql;Initial Catalog=nmcvisualdb;Persist Security Info=True;User ID=sa;Password=xxxxx");
}
//CCaseObject gg = new CCaseObject("test1-lil");
int idx = 0;
while (true)
{
System.Console.WriteLine("Starting");
doWork();
idx++;
System.Console.WriteLine("parsing: " + idx.ToString());
Thread.Sleep(80 * 1000);
}
}
public static void doWork()
{
BaseFuncs theBaseFuncs = new Foundation.BaseFuncs();
//D:\Google Drev\CloudHotFolder
//E:\google-drive\Google Drive\CloudHotFolder
DirectoryInfo dirInfo = new DirectoryInfo(@"D:\Google Drev\CloudHotFolder");
//DirectoryInfo dirInfo = new DirectoryInfo(@"E:\google-drive\Google Drive\CloudHotFolder");
FileInfo[] files = dirInfo.GetFiles("*.jpg");
string caseno = "";
string imageType = "";
string previousCaseno = "";
int i = 0;
System.Console.WriteLine("files: " + files.Count().ToString());
while (i < files.Count())
{
FileInfo fileItem = files[i];
bool nameOK = true;
bool isError = fileItem.Name.Contains("Error");
string[] fileData = fileItem.Name.Split('#');
if (fileData.Length < 2)
{
nameOK = false;
}
else
{
caseno = fileData[1];
imageType = fileData[2];
}
System.Console.WriteLine("parsing file: " + fileItem.FullName);
/*
* photo_org = 1,
floor_plan_org = 2,
Panorama_360 = 3,
photo_stage_2 = 4,
floor_plan_stage_2 = 5,
photo_thumbnail = 6,
Panorama_360_stage_2 = 7,
photo_final = 8,
floor_plan_final = 9,
Panorama_360_final = 10,
deleted = 11,
junk = 12,
visual_tour_org = 12,
visual_tour = 13
* */
string imgtypeid = "";
bool typeOK = true;
bool caseOK = true;
switch (imageType)
{
case "1":
case "4":
imgtypeid = "4"; //photo stage 2
break;
case "2":
case "5":
imgtypeid = "5"; //floor plan stage 2
break;
case "3":
case "7":
imgtypeid = "7";
break;
default:
typeOK = false;
break;
}
string sql = "select count(id) from cases where caseno ='" + caseno + "'";
string casecount = theBaseFuncs.doSQLScalar(sql);
if (casecount != "1")
{
caseOK = false;
}
if (typeOK && !isError && caseOK && nameOK)
{
try
{ //(expiryDate - DateTime.Now).Days < 30
if ((DateTime.Now - fileItem.LastAccessTime).Minutes > 1 && fileItem.Length > 10)
{
//check if filename exists
string checkSql = "select count (id) from images where case_id=" + theBaseFuncs.getCaseIDByCaseNo(caseno) + " and image_name='" + fileItem.Name + "'";
int count = Convert.ToInt16(theBaseFuncs.doSQLScalar(checkSql));
if (count > 0)
{
//delete image in db - and then normal upload new version
System.Console.Write("Deleting " + fileItem.Name + "in DB");
string delImages = "delete from images where case_id=" + theBaseFuncs.getCaseIDByCaseNo(caseno) + " and image_name='" + fileItem.Name + "'";
theBaseFuncs.doSQLnonQuery(delImages);
System.Console.Write("...Done");
}
int picID = theBaseFuncs.saveIMG2DB(fileItem, fileItem.Name, "image/jpeg", caseno, imgtypeid, 5, false);
SqlConnection connection = new SqlConnection("Data Source=xx.xxx.xxx.xxx\\bcwebsql;Initial Catalog=nmcvisualdb;Persist Security Info=True;User ID=sa;Password=xxxxx");
System.Drawing.Image img = System.Drawing.Image.FromFile(fileItem.FullName);
//System.Drawing.Image thumbImg = createHQThumb(fullImg, xparm);
string strSql = "UPDATE Images set Image_Data_Thumb=@imagedata ";
strSql += "where id=@picid";
SqlCommand updatecmd = new SqlCommand(strSql, connection);
updatecmd.CommandType = CommandType.Text;
SqlParameter pImg = new SqlParameter("@imagedata", SqlDbType.Image);
pImg.Value = BaseFuncs.imageToByteArray(BaseFuncs.createHQThumb(img, 600));
img.Dispose();
updatecmd.Parameters.Add(pImg);
SqlParameter pPicid = new SqlParameter("@picid", SqlDbType.Int);
pPicid.Value = picID;
updatecmd.Parameters.Add(pPicid);
connection.Open();
updatecmd.ExecuteNonQuery();
fileItem.Delete();
connection.Close();
//System.Console.WriteLine("counter: i=" + i.ToString() + " max=" + files.Count().ToString());
}
if (caseno != previousCaseno || i == files.Count() - 1) //do target check
{
if (i == files.Count())
{
System.Console.WriteLine("swapping caseno - lastfile in list!");
previousCaseno = caseno;
}
System.Console.Write("Making target check case: " + previousCaseno);
theBaseFuncs.logStatus(theBaseFuncs.getCaseIDByCaseNo(caseno), 3, 36, "Hotfolder target check");
if (theBaseFuncs.targetImgCheck(previousCaseno) == 1 && theBaseFuncs.targetPlanCheck(previousCaseno) == 1)
{
System.Console.Write("...target match");
Foundation.CCaseObject theCase = new Foundation.CCaseObject(previousCaseno);
theBaseFuncs.logStatus(theCase.CaseID, 3, 36, "Hotfolder target OK");
theCase.sendToNaming();
System.Console.Write("...case sent!!!!!!!!\n");
}
else
{
theBaseFuncs.logStatus(theBaseFuncs.getCaseIDByCaseNo(caseno), 3, 36, "Hotfolder target not OK");
System.Console.Write(".no match!\n");
}
}
previousCaseno = caseno;
}
catch (Exception ex)
{
string gg = ex.Message;
throw;
}
}
else
{
if (!isError)
{
fileItem.MoveTo(fileItem.FullName + ".type_error");
}
if (!caseOK)
{
fileItem.MoveTo(fileItem.FullName + ".caseno_error");
}
if (!nameOK)
{
fileItem.MoveTo(fileItem.FullName + ".navngivning_error");
}
}
i++;
}
}
}
}
modified 5-Oct-12 4:08am.
|
|
|
|
|
Firstly your code is not formatted so it is very difficult to read, please surround it with <pre> tags. Secondly, people here are unlikely to spend time analysing this code for you. Try it yourself to see whether it suits your needs and come back here when you have a more specific question.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
This is totally the wrong way to ask a question. See here[^].
First try yourself, if you get stuck or don't understand a specific part of it, come back here.
Nobody will do the work for you, but generally will point you in the right direction if they can.
|
|
|
|
|
my solution has two project. one is my actual project and another one is setup project. my actual project has one report folder where i store my all ssrs report.i have one folder in setup project called "SSRS_Repor". now i want that when i will do batch build then setup for my project regenerate and then i want to copy all files from report folder of my actual project to SSRS_Repor in my setup project. if i can do this kind of automation of copying files from one location to another folder of my setup project then i could be get rid of manual copying of rdls files. i hard this is possible by setup/deployment projects. i search google for this for details step-by-step instruction but got no good link. so please guide me how can i do it.
i post it to another forum too and some one told me below this
Open or create a setup/deployment project in Visual Studio 2005
Press F4 to display the Properties window
Click on the name of your setup/deployment project in the Solution Explorer
Click on the PostBuildEvent item in the Properties window to cause a button labeled "..." to appear
Click on the "..." button to display the Post-build Event Command Line dialog
Add a command line of your choice in the Post-build event command line text box
Build your project in Visual Studio and verify that the post-build event is executed after the main MSI build
so it is ok but what i need to write for copying files from one location to another location that is not clear to me. so now this is most important for me what to write for copying file during setup generation.
i got another clue like below one. script for setup Pre/Post Build Event but not aware properly. i got a sample like
copy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)lib\$(ProjectName).dll"
the above statement or line is not clear to me. what i need to write in my case? so need step-by-step guide.
tbhattacharjee
|
|
|
|
|
copy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)lib\$(ProjectName).dll"
This command copies a dll with the same name as the project, from the directory where it has been created to a directory called lib under the main solution directory. The /Y suppresses prompts to the user to confirm overwriting existing files. You can check the values of the macro parameters by editing the command and clicking on the Macros >> button.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
we know that a solution can have multiple project. so my solution has got two project like one is my main project and another is setup project.my main project has report folder and setup project has report folder too. now i want to write a script like as example copy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)lib\$(ProjectName).dll"
which will copy all rdlc files from report folder of my main project to report folder of setup project. can you please give me a right script which will copy all rdlc files from report folder of my main project to report folder of setup project.
so just click on this link http://i.stack.imgur.com/hEZBa.png and you see my project structure and also understand from where i want to copy all rdlc files. thanks
tbhattacharjee
|
|
|
|
|
As I said before, you can find the relevant directory paths from the macros in your project, so you just need something like :
copy /Y "$(ProjectDir)rdlcdir\*.rdlc" "$(SolutionDir)lib"
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello. I am confronting basic polymorphic issue in my small project. Classes Layer1 use classes from Layer2. Here is my design for Layer1
public class BaseLayer1
{
public virtual Function()
{}
}
public class ChildLayer1 : BaseLayer1
{
BaseLayer2 base2 = new BaseLayer2();
public override Function()
{
base2.Function();
}
}
Now overriden function in child class gets called here. But virtual function in base class from Layer2 is not getting called here (hence; in child classes of Layer2 as well) . Here is what I am trying
public class BaseLayer2
{
public virtual Function()
{}
}
public class Child1Layer2 : BaseLayer2
{
public override Function()
{}
}
public class Child2Layer2 : Child1Layer2
{
public override Function()
{}
}
What's wrong with my understanding with polymorphism in c# ? Thanks for any pointers.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
When you everride a method, that gets called instead of the one in the base class, not as well as.
If you need the base class's method to be called as well, the inheriting class should call base.Function() .
|
|
|
|
|
DaveyM69 wrote: If you need the base class's method to be called as well, the inheriting class should call base.Function()
Thanks for reply. As mentioned earlier, I have divided my classes in two layers.
If see my first piece of code in Layer1 again, I have commented that: Should go to Base Class in Layer2 as well. Which means I am calling methods of some other class (not the Base Class of Layer1).
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Ahh, I think I understand what you mean now.
You expect that the classes derived from BaseLayer2 will have their Function() called when you call base2.Function() ?
If so, that will only happen if the BaseLayer2 instance you call the method on (base2 ) is actually one of the derived classes. So:
BaseLayer2 base2 = new Child1Layer2();
or
BaseLayer2 base2 = new Child2Layer2();
|
|
|
|
|
THANK YOU. This is what I exactly meant. Since I am really learning it, can you explain WHY? Because this works absolutely fine in C++.
This world is going to explode due to international politics, SOON.
|
|
|
|
|