|
I have the page break problem in my report. In the report first I placed a table with contains 50 rows(data will be shown in two pages) and after the table I placed the matrix object becuase the number of cols is not fixex. The problem is that if the number of columns in the matrix is greater than 10 then it prints the remaining columns in the next page but at the same I am getting the page breaks in the first table i.e between 1St and 2nd page I am getting page break.
How can I delete the page breaks.
Kalyan
|
|
|
|
|
Hello guys,
I have a lot of documents in filesystem of a web server (1). An other web server (2) should offer access to this documents too. That works fine and my generated links to the documents will load the document inside the browser.
My problem is, the documents (the name, not the data !!!) and the path are administer in a database and I have a test, if the document exist, before I provide the link. The code for test is follows:
fi = New FileInfo(strPhysPath)
If fi.Exists = False Then
' do an error message here
else
' generate a link
end if
For this check I need a physical path and I have it in different ways. As "normal path" (i.e. "x:\documents\pdf\test.pdf"), if the code runs on web server1 (the server, where the documents are stored), as UNC-Path to a shared folder (i.e. "\\server1\documents\pdf\test.pdf") and/or as a network drive path using the shared folder (i.e. "y:\pdf\test.pdf" where y: -> \\server1\documents). The last both variants I must use on web server2 and here I get always: File not exist using the code above. No errors, no execptions.
Why? Did anybody have other ideas ?
Thank you very much
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=http:
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Well, If you are using a normal default app pool for this website most likely you are trying to access these files with the aspnet user. My guess would be that this user does not have file permissions to read the directory. NOTE if you do give aspnet user read permissions to the directory it can be a security issue.
The only other thing I can think of is using the System.IO.File.Exists instead of using the FileInfo class.
Hope that helps.
Ben
|
|
|
|
|
Hello Ben,
An application pool is it not and this is not possible.
Your second idea works, but I have also a test for the filelength (System.IO.FileInfo.Length). Did you have an idea to change this part too?
Thanks
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=http:
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Since you are using VB.net you can try:
Dim MySize As Long
' Returns file length (bytes).
MySize = FileLen("TESTFILE")
Otherwise you are stuck with the FileInfo Class
Ben
|
|
|
|
|
i have this scene
i have load x page.aspx this page call a function javascript this function call a web service it receives a string
next
in my page have a hidden field it is a hidden texbox and the javascritp function pass the value to a hidden texbox
example
client side
window.Form1.lblRid.value = cadena[0];
when the user postback i use the hidden field to x actions
example
server side
If lblRid.Text <> "" Then
this technique is very bad could that to create an hidden field for each occasion
thanks for the time
|
|
|
|
|
I would suggest instead using a hidden field like this:
In the javascript you can do this:
document.getElementById("content").value =
This in your .net code behind you can do this:
Request.Form["content"].ToString();
Hope that helps.
Ben
|
|
|
|
|
ya. i think, using hidden field is an idea..
Maybe, you can also read "Accessing the Client-side variable (variable named “str” in this sample ) from Server-side Code" from article.
|
|
|
|
|
i have limited the max length of the text box through javascripting .When the users wants to add more text the label on the page should read a message like maximum text has exceeded ...
The problem is through javascripting i am not getting the label control.
help!!
thanks in advance .
|
|
|
|
|
document.getElementById("label1").innerText = "maximum text has exceeded "
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
One more suggestion..
sometimes, Server control name and the name of the control at runtim might be different. Eg: You named the lable as "label1". but this label name might be something else (eg: ctl_label1) after rendering HTML.. so, better to make sure the id that you want include in your page.
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 here. Thank you.
|
|
|
|
|
hey can any buddy help me to send /view a video clip on a mobile using asp.net.
plz its urgent.
|
|
|
|
|
|
Hi all,
Is is possible via an asp.net application which resides on a IIS 6.0 server which is also part of the Domain I wish to interact with, query which domain users are logged on?
Look forward to your responses
Cheers
Simon
|
|
|
|
|
|
Hi Sylvester,
Thanks for your reply.
That link is interesting. But what I am trying to do is find all the logged into user to the Windows Domain/Active Directory - then display them as a wall board type web page. I have been searching for a while now and can't seem to find anything.
Regards,
Simon
|
|
|
|
|
Ref and Sample file download ~
Michael Sync's Blog ~ Getting All Users Information from Domain in ASP.NET
Step #1: Disable "Anonymous Access" of Virtual Directory
- Open Internet Information Service (IIS)
- Go to "Properties of your Virtual Directiory"
- Go to "Directory Security" tab
- Click "Edit" button of "Anonymous access and autherntication control"
- Uncheck "Anonymous access"
Step #2: Enabled impersonating in Web.Config
Add the tag below under in Web.config.
<p><identity impersonate="true"/></p>
Step #3: Adding "System.Directory.Services" dll as reference
<p>System.Directory.Services</p>
Open ASP.NET Web project. And add this dll to your project.
Step #4: Put the following code in PageLoad
Code for getting all users from domain
try
{
DirectorySearcher searcher=new DirectorySearcher();
string rootDSE=searcher.SearchRoot.Path;
DirectoryEntry entry = new DirectoryEntry(rootDSE);
DirectorySearcher dirSearcher = new DirectorySearcher(entry);
dirSearcher.Filter = "(&(objectClass=user))";
dirSearcher.SearchScope=SearchScope.Subtree;
dirSearcher.Sort.Direction=System.DirectoryServices.SortDirection.Ascending;
dirSearcher.Sort.PropertyName="cn";
ArrayList domainMembers = new ArrayList();
foreach(SearchResult result in dirSearcher.FindAll())
{
try
{
string strUserInfo = string.Empty;
DirectoryEntry de=result.GetDirectoryEntry();
if(de.Properties.Contains("sAMAccountName"))
strUserInfo = de.Properties["sAMAccountName"].Value.ToString();
domainMembers.Add(strUserInfo);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
DataGrid1.DataSource = domainMembers;
DataGrid1.DataBind();
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
You might get the following errors.
- An operations error occurred
- The specified domain either does not exist or could not be contacted
If you are getting these errors above, please make sure that you have permission to access your domain.
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". Thank you.
|
|
|
|
|
Hi All,
I got an issue with my application. My application has a datagrid with filter option
So placed dropdownlist in header template of datagrid and made data bound to dropdownlist. But i cant access the selectedIndexchange property of drop down list
In-line coding
~~~~~~~~~~~~~~
<asp:datagrid id="DataGrid1" runat="server" autogeneratecolumns="False"
-----some="" lines
within="" headertemplate
asp:dropdownlist="" autopostback="True"
onselectedindexchanged="DropDown_SelectedIndexChanged"
within="" headertemplate
---some="" lines
<="" asp:datagrid="">
Code Behind
~~~~~~~~~~~~~
Protected Sub DropDown_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
'some code will run here
End Sub
Pls help me
Kannapiran
|
|
|
|
|
Please check ur posted code here.
pathan
|
|
|
|
|
hi
convert ur columns to template columns
like
<asp:templatecolumn headertext="Color Pattern" headerstyle-width="70px">
<headertemplate>
<asp:radiobutton id="clr0" runat="server" width="70px" text="Pattern" groupname="Color" font-name="Arial"
="" font-size="X-Small">
<itemtemplate>
<asp:label runat="server" text="<%# DataBinder.Eval(Container, "DataItem.ColorPattern") %>" width="70px">
<edititemtemplate>
<asp:textbox runat="server" text="<%# DataBinder.Eval(Container, "DataItem.ColorPattern") %>" width="70px">
|
|
|
|
|
<headertemplate>
<asp:dropdownlist id="ddl" runat="server">
|
|
|
|
|
Hi
Is it possible to manipulate data in MS Access using javascript.
(We can access excel using javascript)
If yes then please help me with the code
Regards
Karan
|
|
|
|
|
JavaScript - Working with Database
After reading this coding, you will know the following facts.
How to connect the database in JavaScript
How to use the ADODB.Recordset in JavaScript
As I already put the details comments in coding, I hope you will find it useful.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript">
<!–
var adOpenDynamic = 2;
var adLockOptimistic = 3;
/* Path of database.
If you put the database "Inventory.mdb" in different location,
you need to specify the correct path to this variable.
But When you are running the webpage from Browsers only,
you should use this keyword "window.location.pathname" for getting
the current location. But If you are using FrontPage,
you hav to specity the static path.
*/
var strDbPath = "C:\\JavaScript Database\\Inventory.mdb";
/*
Here is the ConnectionString for Microsoft Access.
If you wanna use SQL or other databases, you hav
to change the connection string..
eg: SQL => var conn_str = "Provider=sqloledb; Data Source=itdev;" +
"Initial Catalog=pubs; User ID=sa;Password=yourpassword";
*/
var conn_str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strDbPath;
function getAdoDb(strAdoType){
if (window.ActiveXObject){
return new ActiveXObject(strAdoType);
}
else{
return new ActiveXObject(strAdoType);
}
}
function showReports(){
try{
var strHtml ="";
strHtml += "<table cellpadding=0 cellspacing=0 border=1 width=500px align=center>";
strHtml += "<tr ><td align=center colspan=4><b>Stock List</b></td></tr>";
//Database Connection
var conn = getAdoDb("ADODB.Connection");
conn.open(conn_str, "", "");
//Recordset
var rs = getAdoDb("ADODB.Recordset");
strQuery = "SELECT StockID,StockName,ReOrderLevel,IsActive FROM Stocks";
rs.open(strQuery, conn, adOpenDynamic, adLockOptimistic);
if(!rs.bof){
rs.MoveFirst();
while(!rs.eof) {
strHtml += "<tr>";
strHtml += " <td width=\"10px\">" + rs.fields(0).value + "</td>";
strHtml += " <td width=\"50px\">" + rs.fields(1).value + "</td>";
strHtml += " <td width=\"10px\">" + rs.fields(2).value + "</td>";
strHtml += " <td width=\"5px\">" + rs.fields(3).value + "</td>";
strHtml += "</tr>";
rs.MoveNext();
}
}
else{
//No Records.
strHtml += "<tr colspan=4><td align=center><font color=red>No Records.</font></td></tr>";
}
conn.close();
strHtml += "</table>";
document.write(strHtml);
}catch(ex){
alert(ex.message);
}
}
//–>
</script>
<title>Stock List</title>
</head>
<!–<body onload="show_menu()">
<div id="main" />–>
<body>
<script language="JavaScript">
showReports();
</script>
</body>
</html>
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
And if the user isn't running IE?
|
|
|
|
|
these are the objects you can use to connect database.
=====================================================
this supports both IE and NNav
DbPool Constructors
Name MSIE NNav Notes
DbPool() - -
DbPool Methods
Name MSIE NNav Notes
connect() - -
connected() - -
connection() - -
disconnect() - -
majorErrorCode() - -
majorErrorMessage() - -
minorErrorCode() - -
minorErrorMessage() - -
storedProcArgs() - -
toString() - -
DbPool Properties
Name MSIE NNav Notes
prototype - -
this link will help you
=======================
http://docs.sun.com/source/816-6410-10/dbpool.htm[^]
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|