|
I need to customize the application so i need it in asp.net
|
|
|
|
|
Hi,
I am trying to preview the individual pages found inside a multipage TIFF file as thumbnails using PictureBoxes on an ASP.NET aspx page.
Microsoft Office Document Imaging 12.0 (MODI) - is the release which came with Office 2007.
What I am trying to do is split a mulit-page TIFF file using MODI into single pages. Once I've got the pages, I want to show the individual page's thumbnail in a PictureBox in an ASP.NET aspx page.
At the same time I want to OCR the individual pages, as I am using the text found inside each page - which is why I am using MODI.
Using MODI to split the TIFF file seems to work fine - and I can OCR each page and count the words, etc.
Here is the code which does that:
MODI.Document objDoc = new MODI.Document();
//strFileName below is a string variable pointing to the file location of a TIFF file
objDoc.Create(strFileName);
objDoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
int nWordCount = 0;
int nPageCount = objDoc.Images.Count;
string strOCR = "";
//Now I cycle through each page (which is an image)
for (int x = 0; x < objDoc.Images.Count; x++)
{
MODI.Image objImage = (MODI.Image)objDoc.Images[x];
//At this point I want to extract the thumbnail property from the objImage using something like this:
//pictureBox1.Image = ConvertToImageFromIPictureDisp( objImage.get_Thumbnail(MODI.MiTHUMBNAIL_SIZE.miTHUMB_SIZE_LARGE));
MODI.Layout objLayout = objImage.Layout;
//to get a specific word, you can get it at an index, for instance word number 5:
//MODI.Word word = (MODI.Word)objLayout.Words[5];
//I want all words
nWordCount += objLayout.Words.Count;
for (int i = 0; i < objLayout.Words.Count; i++)
{
MODI.Word objWord = (MODI.Word)objLayout.Words[i];
strOCR += objWord.Text;
}
}
objDoc.Close(false);
So at this point, you have OCR'ed the entire TIFF file, and the variable strOCR will have your text with which you can do what you want.
The problem I am getting and with which I am trying to find some help, is that in the same piece of code above, I want to add a piece to extract the thumbnail of each image (page).
So inside the for x loop just after MODI.Image objImage = (MODI.Image)objDoc.Images[x];
I want to extract the thumbnail using this piece of code:
objImage.get_Thumbnail(MODI.MiTHUMBNAIL_SIZE.miTHUMB_SIZE_LARGE)
get_Thumbnail returns of type IPictureDisp (add a reference to stdole to access this interface)
A PictureBox's image property is of type System.Drawing.Image
So how do I convert my IPictureDisp to an Image so that I can use it in a PictureBox?
I've tried to use a class (which inherits from System.Windows.Forms.AxHost) with the following method:
public static System.Drawing.Image ConvertIPictureToImage
(stdole.IPictureDisp picture)
{
return (System.Drawing.Image)System.Windows.Forms.AxHost
.GetPictureFromIPictureDisp(picture);
}
but the exception I get is this: Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))
So I am stuck at this point.
Has anybody come across this and do you perhaps know how to resolve this issue?
Cheers
|
|
|
|
|
Hi All,
I need to add a Sub-Report to A Main Report in Crystal Reports 10,I am using Visual Studio 2005 as IDE..
The Sub-Report is using a stored procedure & main report is using another Stored Procedure.When i add the requisite parameters to the Main -Report of the sub-report the report doesnt show up..
I have tried searching on google but i havent found found any relevant thing..
Please Anyone could help me Regarding Crystal Reports..
I am using Crystal Reports in an ASP.NET Web Application
Reply..
Thanks in Advance
Robin
|
|
|
|
|
hi all
i have problem when get value on textbox.
i have page default.aspx contain usercontrol demo.ascx
into demo.ascx have function load control dynamic
private void LoadControl(mapObj map)
{
try
{
strLayerName = searchlayer.SelectedValue;
clsBusQuery objQuery = new clsBusQuery();
DataTable dt = new DataTable();
dt = objQuery.LoadNameColunm(strLayerName);
string strTempValue = "";
for (int i = 0; i < dt.Columns.Count; i++)
{
string strFieldName = dt.Columns[i].ColumnName;
if (strFieldName != "id" && strFieldName != "gid" && strFieldName != "the_geom" && strFieldName != "Shape")
{
//khoi tao 1 row
htmTableRow = new HtmlTableRow();
//khoi tao cell
htmTaleCell = new HtmlTableCell();
lblLable = new Label();
lblLable.ID = "lbl" + strFieldName;
lblLable.Text = strFieldName + ": ";
htmTaleCell.Controls.Add(lblLable);
htmTableRow.Cells.Add(htmTaleCell);
htmTaleCell = new HtmlTableCell();
txtbox = new TextBox();
txtbox.ID = "txt" + strFieldName;
htmTaleCell.Controls.Add(txtbox);
htmTableRow.Cells.Add(htmTaleCell);
addform.Rows.Add(htmTableRow);
if (strTempValue == "")
{
strTempValue = strFieldName;
}
else
{
strTempValue += "," + strFieldName;
}
}
}
NameField.Value = strTempValue;
}
catch (Exception ex)
{
throw ex;
}
}
after load finish control i click button submit
and i get data on textbox by command
Resquest.From[namecontrol] with usercontrol have ctl02$namecontrol but it not get some body tell me
|
|
|
|
|
Is your button in .aspx page or in usercontrol?
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
thanks reply to me
i got this value;P
|
|
|
|
|
I want to use an AJAX control on an ASP Net page. The setup instructions require a path to my cache directory. What's required in setting up a cache directory?
PJ
|
|
|
|
|
Which setup instructions are you talking of?
Never heard of a cache directory in conjunction with AJAX (I'm using ASP.NET Ajax).
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
One of the php files has the following lines of code. I don't know what path I should put in here '$rss->cache_dir = ? '. I've copied in the instructions below.
header('Content-type: text/xml');
// include lastRSS
include "lastRSS.php"; //path to lastRSS.php on your server from this script ("bridge.php")
// Create lastRSS object
$rss = new lastRSS;
$rss->cache_dir = 'cache'; //path to cache directory on your server from this script. Chmod 777!
$rss->date_format = 'M d, Y g:i:s A'; //date format of RSS item. See PHP date() function for possible input.
PJ
|
|
|
|
|
Aha! PHP.
You posted in the ASP.NET forum. Please post your question in the correct forum: Web Development or in a PHP specific forum. There you should find people that can help you.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
I have Drop down list below the calendar popup
My Problem is My Popup not shown over the drop down list
It works in mozilla and fails to work in IE6
I tried Z-index properties but not doing well
Is There any solution
swapnil
|
|
|
|
|
Yeah this is a fairly well known bug in IE. Root cause is that IE uses lightweight controls, except for drop down lists, which always render on top.
You can get around this by sticking an empty iframe in the item that pops up, width and height 100% but given a z-order to make it at the bottom. This works because the iframe ends up being rendered after the drop down list, forcing all the controls that are higher than the iframe to the top.
Bit dodgy though, and I've never really liked it. The other option I've seen uses js to hide the drop down lists when the calendar / menu pops up. :/
|
|
|
|
|
Hello All,
I am having a webform with two textbox and and one dropdownlist .. and one gridview
when i entered values in textbox and select dropdownlist value after that i click on save button then it will save in database.
and the display the textbox value and dropdownlist selected value in GridView what i taken in the same page .
The following code i wrote for in codebehind:
protected void Save_Click(object sender, EventArgs e)
{
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Mfund_String"].ConnectionString))
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into mfund_share_dtls values(" + this.TextBox1.Text + ",'" + this.ddlFund_name.SelectedItem.Value + "','" + this.ddlDOBdd.SelectedItem.Value + '-' + this.ddlDOBmm.SelectedItem.Value + '-' + this.ddlDOByyyy.SelectedItem.Value + "'," + this.txtNoUnits.Text + "," + this.txtPricePaid.Text + ")", con);
cmd.ExecuteNonQuery();
SqlCommand cmd1 = new SqlCommand("SELECT fund_no, usr_no, fund_name, dop, no_units, price_paid FROM mfund_share_dtls WHERE(usr_no = " + this.TextBox1.Text + ") AND (fund_no =(SELECT MAX(fund_no) AS Expr1 FROM mfund_share_dtls AS mfund_share_dtls_1 WHERE(usr_no = " + this.TextBox1.Text + ")))", con);
SqlDataReader dbdr = cmd1.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dbdr);
dbdr.Close();
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
So now i want in gridview edit... suppose the client mistakenly chosen wrong dropdownlist value and enterd wrong textbox value,
so now he want to edit the dropdownlist value and textbox value in gridview.
How i have to approach for gridview update through code behind and please guide me ...i need to display the dropdownlist also to select correct dropdownlist value in gridview update.
Many Thanks
Vijay
|
|
|
|
|
Hai,
I am using dotnetFramework1.1 with C# coding for my project.
I need to display some Records.So i use DataList Control For that...But my Problem is that when I click a particular row ,i want to redirect to some other page showing the full description of that particular record.How is this possible????....Please hepl me to solve my proble....
thanks in advance
Bijesh
|
|
|
|
|
Use Template Column in DataList control. Put the LinkControl in that template column.
OR
<a href="http://mysite/anotherpage.aspx?id=1" > <%# DataBinder.Eval(Container.DataItem,"fieldName") %></a>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hello,
i am new to asp.net.....By using "id=1" in query string How we can recognize each different recods data....I try this but some error comes....any modification need my code.......
<%# DataBinder.Eval(Container.DataItem,"fieldName") %>
--------------------------------------------------------------------------
>
<asp:button
="" style="display:none;" commandargument="<%# DataBinder.Eval(Container.DataItem,"AD_TITLE")%>" id="HiddenButton" runat="server" text="View">
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %>
<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>
<%# DataBinder.Eval(Container.DataItem,"AD_DESCRIPTION") %>
Price:
<%# DataBinder.Eval(Container.DataItem,"PRICE") %>
Location:
<%# DataBinder.Eval(Container.DataItem,"LOCATION") %>
this is the code what i used or please help me by using template column link control.....
thanks in advance
|
|
|
|
|
<a href="http://mysite/anotherpage.aspx?id=<%# DataBinder.Eval(Container.DataItem,"fieldName") %>" > <%# DataBinder.Eval(Container.DataItem,"fieldName") %></a>
bijeshputhalath wrote: please help me by using template column link control.....
<asp:DataList id="DataList1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"><br />
<ItemTemplate><br />
<asp:HyperLink id="HyperLink1" runat="server" NavigateUrl="<%# DataBinder.Eval(Container.DataItem,"fieldName") %>"><%# DataBinder.Eval(Container.DataItem,"fieldName") %></asp:HyperLink><br />
</ItemTemplate><br />
</asp:DataList>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hello,
Thank you so much....i use the first method.....it is working fine.....But in my query string, i send 3 parameters(Becoz if i send only one parameter if any records with same data i,it will display the first record)...But i cant retrieve it all the three and getting some error .
----------------------------------------------------------------------------
i used the following code in html
>
<asp:button
="" style="display:none;" commandargument="<%# DataBinder.Eval(Container.DataItem,"AD_TITLE")%>" id="HiddenButton" runat="server" text="View">
,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>">
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %>
<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>
<%# DataBinder.Eval(Container.DataItem,"AD_DESCRIPTION") %>
Price:
<%# DataBinder.Eval(Container.DataItem,"PRICE") %>
Location:
<%# DataBinder.Eval(Container.DataItem,"LOCATION") %>
----------------------------------------------------------------------------
and in my target page i use
string search,type1,price;
search=Request.QueryString["li"].ToString();
type1=Request.QueryString["type"].ToString();
price=Request.QueryString["price"].ToString();
Label1.Text=search;
string sstr="select * FROM ads where AD_TITLE='"+search+"' && PRICE='"+price+"' && AD_TYPE='"+type1+"'";
sdr=conobj.reader(sstr);
----------------------------------------------------------------------------
But i get the following error
Server Error in '/approvedplotfinal' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 45:
Line 46: search=Request.QueryString["li"].ToString();
Line 47: type1=Request.QueryString["type"].ToString();
Line 48: price=Request.QueryString["price"].ToString();
Line 49: Label1.Text=search;
----------------------------------------------------------------------------
Please help me to trace out.......
thanks again....
Biju
|
|
|
|
|
When you are posting the HTML code, please check "Ignore HTML tags in this message". otherwise, all code will be strips off..
Can you post your code again?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
this the target page URL:::
"http://localhost/approvedplotfinal/classified/AddView.aspx?li=search%20of%20a%20new%20plot,type=Wanted,price=5000"
My target page code like this-----------------------------------------------------------------------------
string search,type1,price;
//Session["li"].ToString();
search=Request.QueryString["li"].ToString();
type1=Request.QueryString["type"].ToString();
price=Request.QueryString["price"].ToString();
Label1.Text=search;
string sstr="select * FROM ads where AD_TITLE='"+search+"'&& AD_TYPE='"+type1+"' && PRICE='"+price+"' ";
sdr=conobj.reader(sstr);
while(sdr.Read())
{
}
----------------------------------------------------------------------------
This is the htmal part
<ItemTemplate>
<tr <%# TRJavaScript(Container) %> >
<td><asp:Button
style="display:none;"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"AD_TITLE")%>'
ID="HiddenButton" Runat="server" Text="View">
</asp:Button>
<a href="http://localhost/approvedplotfinal/classified/AddView.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>">
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %>
</a>
<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>
<br>
<%# DataBinder.Eval(Container.DataItem,"AD_DESCRIPTION") %>
<br>
Price:
<%# DataBinder.Eval(Container.DataItem,"PRICE") %>
<br>
Location:
<%# DataBinder.Eval(Container.DataItem,"LOCATION") %>
<br>
</tr>
</ItemTemplate>
----------------------------------------------------------------------------
please help.....
i need to hit a target page with these parameters ....
thanks
Biju
|
|
|
|
|
bijeshputhalath wrote: li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE")
should be "&" (not ",") eg: http://myurl.com/page1.aspx?a=1&b=2&c=3
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hello ,
I try with "&" also Before your suggetion with & operator....But the same error comes still.....
my problem is that...How can i retrieve each query string value
li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>&type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>&price=<%# DataBinder.Eval(Container.DataItem,"PRICE")
With these coding ,it will work or not????
string search,type1,price;
search=Request.QueryString["li"].ToString();
type1=Request.QueryString["type"].ToString();
price=Request.QueryString["price"].ToString();
Label1.Text=search;
string sstr="select * FROM ads where AD_TITLE='"+search+"'&& AD_TYPE='"+type1+"' && PRICE='"+price+"' ";
sdr=conobj.reader(sstr);
while(sdr.Read())
{
}
what is my mistake ...????Please help me....
with regards and thanks
Biju
|
|
|
|
|
Okay. Lets debug the application..
Let's say we have two pages called page1 and page2. We will divide the issue into small pieces ~
1. Using static data in page1
2. Retrieving the data in page2
3. Checking whether the SQL statment is correct or not
4. Changing static data to dynamic data in page1.
1. Using static data in page1
We will remove all dynamic value in A link to avoid NULL value and "".
Note: dynamic value means <%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>.
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>"><br />
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %><br />
</a><br />
We will replace all dynamic value with all static value.
<br />
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=mytitle&type=mytype&price=100" ><br />
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %><br />
</a>
Run the application to check whether there is any error or not.
2. Retrieving the data in page2
Forget about other code in page2. We will assume that we have only the following lines in Page Load.
search=Request.QueryString["li"].ToString();
type1=Request.QueryString["type"].ToString();
price=Request.QueryString["price"].ToString();
- Set the breakpoint at "search" variable.
- Run the application. (Page1 is start-up page)
- Click the link in page1. (it will take you to page2.)
- Check whether "Request.QueryString["li"] " is null or not.
- Check whether "Request.QueryString["type"] " is null or not.
- Check whether "Request.QueryString["price"] " is null or not.
Note: All three parameters should not be NULL. If you are getting NULL then let me know.
3. Checking whether the SQL statment is correct or not
Which Database are you using? If it's SQL Server, you don't need "&&".
string sstr="select * FROM ads where AD_TITLE='"+search+"'&& AD_TYPE='"+type1+"' && PRICE='"+price+"' ";<br />
So, we will change something like that.
string sstr="select * FROM ads where AD_TITLE='" + search + "' AND AD_TYPE = '" + type1 + "' AND PRICE='"+ price + "'";<br />
- Check this variable "sstr" in Quick Watch or Immediate Window.
- Copy the string from Quick Watch or Immediate Window.
- Paste in Query Analyzer and Run it.
(You should not get any error. this is about checking whether the SQL statement is correct or not.)
4. Changing static data to dynamic data in page1.
It is still working fine. we will remove the static code in page and replace with dynamic code.
So, the following code will be used again..
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>"><br />
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %><br />
</a><br />
- Run the application
- Click the link in page1.
- Check the Request.QueryString and SQL Statement in page2.
if it's working until now, you are done..
Please follow the step as I mention here.. let me know the result..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hai,
sorry for delay...
It is very helpful....i done as per your information...it is working fine Now my problem solved...Thanks alot.....But Now arise a new problem..How to set paging in this.???...Please give any idea or sample code.....
instead of "," i use '&'in this code......it is very helpful
-----------------------------------------------------------------------------
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>">
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %>
</a>
-----------------------------------------------------------------------------
thanks once again
Biju
|
|
|
|
|
|