Display files in a folder...
Hello, all. I'm using the stored procedure xp_dirtree to list the files (PDFs in my case) in a folder. In Mgt Studio I correctly get the results. However, I want to use the query results in an SSRS report so that the user can click on a
report name (one of the fields returned) and the file will open in Adode Reader. When I hard code a file path to a PDF in the SELECT statement, the report runs and renders the file listing correctly. However, when I'm dynamically generate the file
listing, the SSRS report returns zero records.
Anyone familiar with displaying a folder's files in SSRS? I'm open to other ideas, thoughts, suggestions.
Thnx
Roz
Hi Roz,
If I understand correctly, you want open a file in Adobe Reader when you click on a file name. We can use “Go to URL” action to get the same effect.
Suppose we have a dataset (DataSet1) with FileName field. Please refer to the steps below:
Share the specify folder.
Add a table in the report body, add FileName field in the table.
Right click the FileName text box, select Tablix Properties.
Click Action in the left pane. Select “Go to URL”. And type below expression:
="file://ServerName/Folder/" & Fields!FileName.Value & ".pdf"
When we deploy the report, we can click the file name to open the corresponding file.
If there are any misunderstanding, please elaborate the issue for further investigation.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support
Similar Messages
-
How use PHP to read image files from a folder and display them in Flex 3 tilelist.
Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
PHP :
PHP Code:
<?php
//Open images directory
$imglist = '';
$dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "filename: " . $file . "\n";
$dir->close();
?>
FLEX 3 :
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.rpc.events.ResultEvent;
public var image:Object;
private function resultHandler(event:ResultEvent):void
image = (event.result);
ta1.text = String(event.result);
private function faultHandler(event:FaultEvent):void
ta1.text = "Fault Response from HTTPService call:\n ";
]]>
</mx:Script>
<mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
<mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
<mx:HTTPService id="pic" url="{phpPicture}" method="POST"
result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
<mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
<mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
</mx:Application>
Thanks. Need help as soon as possbile. URGENT.i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
PHP Code:
<?php
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<root>
<images>
<?php
//Open images directory
$dir = dir("images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
//$dir->close();
?>
</images>
</root>
Flex Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="callPHP();">
<mx:Script>
<![CDATA[
import mx.rpc.http.HTTPService;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var arr:ArrayCollection = new ArrayCollection();
private function callPHP():void
var hs:HTTPService = new HTTPService();
hs.url = 'Picture.php';
hs.addEventListener( ResultEvent.RESULT, resultHandler );
hs.addEventListener( FaultEvent.FAULT, faultHandler )
hs.send();
private function resultHandler( event:ResultEvent ):void
arr = event.result.root.images.image as ArrayCollection;
private function faultHandler( event:FaultEvent ):void
Alert.show( "Fault Response from HTTPService call:\n " );
]]>
</mx:Script>
<mx:TileList id="tilelist"
dataProvider="{arr}">
<mx:itemRenderer>
<mx:Component>
<mx:Image source="images/{data}" />
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Application> -
Display PDF in different window by reading Binary file in MIME folder.
Hi all,
I've kept binary file in MIME folder and I'm trying to read the contents of it. and I'm trying to display contents in pdf format in separate window.
For this I was able to read the file by using FileInputStream
byte[] bytes = new byte[1000];
try
//File file = new File(WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(),"data.bin"));
File file = new File(WDURLGenerator.getResourcePath("test.bin"));
FileInputStream is = new FileInputStream(file);
long length = file.length();
//Create the byte array to hold the data
byte[] bytesA = new byte[(int)length];
//Read in the bytes
int offset = 0;
int numRead = 0;
while (offset < bytesA.length&& (numRead=is.read(bytesA, offset, bytesA.length-offset)) >= 0)
offset += numRead;
is.close();
bytes = bytesA;
wdContext.currentContextElement().setPdfSource(bytes);
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("Error Reading File:"+e.getCause(),true);
wdComponentAPI.getMessageManager().reportException("Error Reading File To String:"+e.toString(),true);
I've to show this in external window. I created attribute "pdfResource" of type binary
and declared in the source
private ISimpleType myPdfDoc;
After that I added this bit of code in Init Method
myPdfDoc = wdContext.getNodeInfo().getAttribute("pdfResource").getModifiableSimpleType();
((IWDModifiableBinaryType)myPdfDoc).setMimeType(WDWebResourceType.PDF);
((IWDModifiableBinaryType)myPdfDoc).setFileName("PDF");
After this I made an action handler which has following code.
final byte[] documentContent = bytes
final String docUrl = myPdfDoc.format( bytes );
String docUrl = myPdfDoc.format(bytes);
IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(docURL,"Resource", true);
window.open();
But it is throwing Null Pointer exception for Init Method and also while displaying.
Where is that I'm faltering. Any Pointers will be help ful
Thanks
SrikantFirst of all why do you need those three lines of code in your wdDoInit() ?
Simply, you may use this:
IWDCachedWebResource cachedResource = null;
String url = null;
byte[] pdf = wdContext.currentContextElement().getPdfSource();
if (pdf != null) {
cachedResource = WDWebResource.getWebResource(pdf, WDWebResourceType.PDF);
url = cachedResource.getURL();
Refer <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/4a/fb8342a7d30d53e10000000a155106/content.htm">Utilizing the IWDCachedWebResource-API</a> for further assistance.
/* Changed the code */
Message was edited by: Bala Krishnan -
Maximum number displayed files in Folder in Dock?
One of our users has over 800 files saved directly in her Documents folder. We keep this folder in the usual location, and also have it displayed in the Dock as a "list". When she clicks on the folder, about the first half of the files show up - if displayed alphabetically for example, she gets A - M.
Does anyone know if this is fixable? I'm assuming here that there is some maximum number of displayed files which maybe I can fix by editing a .plist or something. It drives her nuts to have to do the "open in Finder" thing half the time, but not the other half of the time (obviously, when she opens this folder as a Finder window everything is there, it is only the display in the Dock which refuses to show all items).
Thanks!Thanks for the info. There is indeed a maximum number of files that the dock will show in the contextual menu. Yeah, it would be best if the user wouldn't keep everything organized like that, but it isn't possible to lean over someone's shoulder all the time...
-
To relocate mail.log, mail.log_current file to specific folder
Hi
We have configured CommSuite 6 in single host. The output of imsimta version:
Sun Java(tm) System Messaging Server 7.0-0.04 32bit (built Jun 20 2008)
libimta.so 7.0-0.04 32bit (built 01:01:00, Jun 20 2008)
Using /opt/sun/comms/messaging/config/imta.cnf
SunOS mail 5.10 Generic_120012-14 i86pc i386 i86pc
Output of imta_tailor file:
IMTA_USER=mailsrv
IMTA_USER_USERNAME=nobody
IMTA_WORLD_GROUP=mail
IMTA_LOG=/logs/messaging/imta
IMTA_PRIMARY_LOG=/logs/messaging/imta/mail.log_current
IMTA_SECONDARY_LOG=/logs/messaging/imta/mail.log_yesterday
IMTA_TERTIARY_LOG=/logs/messaging/imta/mail.log
We need to relocate mail.log, mail.log_current, mail.log_yesterday file to specific folder.
After above setting we cannot be able to relocate above file.
Pl. help us.
Thanks
P.K.world.group wrote:
We have configured CommSuite 6 in single host. The output of “imsimta version”:Please note that CommSuite 6 update 1 is now available and it is advisable that you upgrade using the "commpkg upgrade" command.
IMTA_LOG=/logs/messaging/imta
IMTA_PRIMARY_LOG=/logs/messaging/imta/mail.log_current
IMTA_SECONDARY_LOG=/logs/messaging/imta/mail.log_yesterday
IMTA_TERTIARY_LOG=/logs/messaging/imta/mail.logThese parameters are now ignored as per the Messaging Server 7.0 release notes:
http://wikis.sun.com/display/CommSuite6/Messaging+Server+7.0+Release+Notes#MessagingServer7.0ReleaseNotes-Ignoredimtatailorsettings
We need to relocate mail.log, mail.log_current, mail.log_yesterday file to specific folder. You can relocate the MTA log directory through the use of symlinks.
Regards,
Shane. -
How to copy a file from one folder to another folder in Linux
Hello everyone,
Oracle forms 11g 11.1.2.0.0
OS: Oracle Linux
We use webutil to upload files to the application server from the client machine, and stores them in a folder named JOB_DOCS on the application server (This folder is created as a databse directory too). File types are JPEG, GIF, PDF, TXT, BMP, DOC, XLS etc...
At a later stage when the user tries to view the uploaded documents, this was not getting displayed on the screen
on our windows server, when the user clicks on the print button we copy the file from the JOB_DOCS folder to the forms\java folder using the below command
HOST('COPY ' ||d:\JOB_DOCS\test.pdf||' '||'c:\oracle\middleware\as\forms\java\test.pdf ,NO_SCREEN);
once the file is under the forms\java folder then it is getting displayed on the screen to print or save, and later we remove the file from forms\java folder.
But my problem here is, recently we have installed our application on Oracle Linux server, and we have JOB_DOCS folder there, and the users can upload files to this folder also. How can we copy the file test.pdf from JOB_DOCS to forms/java in linux?
And what could be the reson for the document cannot be accessed from the folder where it is saved? We tried giving folder permissions, adding the folder to PATH variable etc.For copying and moving directories you can use the cp and mv commands just like you use them with files. Yeah, I know. If you've already tried to copy a directory with cp, you've probably noticed that cp just complains at you. Probably it says something like cp: omitting directory yadda yadda. You see, the cp command wants you to use the -r option if you want to copy a directory with its contents. The -r means "copy recursively":
$ cp -r dir1 dir2
The above creates a directory named dir2 whose contents will be identical to dir1. However, if dir2 already exists, nothing will be overwritten: the directory dir1 will be copied into the dir2 directory under the name dir2/dir1.
When renaming directories, you use the mv command exactly the same way as with files:
$ mv dir1 dir2
When dealing with directories, mv works a bit like cp does. If dir2 doesn't exist, the above will rename dir1 to dir2, but if dir2 exists, the directory dir1 will be moved into the dir2 directory under the name dir2/dir1.
ref http://www.tuxfiles.org/linuxhelp/dirman.html -
I have been searching high and low for this one. I have a vbscript that can successfully perform the function if one file is listed. It does a Wscript.echo on the results and if I run this via command using cscript, I can output to a text file
that way. However, I cannot seem to get it to work properly if I want it to search ALL the files in the folder. At one point, I was able to have it create the output file and appear as if it worked, but it never showed any results when the script
was executed and folder was scanned. So I am going back to the drawing board and starting from the beginning.
I also have a txt file that contains the list of string text entries I would like it to search for. Just for testing, I placed 4 lines of sample text and one single matching text in various target files and nothing comes back. The current script
I use for each file has been executed with a few hundred string text lines I want it to search against to well over one thousand. It might take awhile, but it works every time. The purpose is to let this run against various log files in a folder and
let it search. There is no deleting, moving, changing of either the target folder/files to run against, nor of the file that contains the strings to search for. It is a search (read) only function, going thru the entire contents of the folder and
when done, performs the loop function and onto the next file to repeat the process until all files are searched. When completed, instead of running a cscript to execute the script and outputting the results to text, I am trying to create that as part
of the overall script. Saving yet another step for me to do.
My current script is set to append to the same results file and will echo [name of file I am searching]: No errors found. Otherwise, the
output shows the filename and the string text that matched. Because the results append to it, I can only run the script against each file separately or create individual output names. I would rather not do that if I could include it all in one.
This would also free me from babysitting it and running each file script separately upon the other's completion. I can continue with my job and come back later and view the completed report all in one. So
if I could perform this on an entire folder, then I would want the entries to include the filename, the line number that the match occurred on in that file and the string text that was matched (each occurrence). I don't want the entire line to be listed
where the error was, just the match itself.
Example: (In the event this doesn't display correctly below, each match, it's corresponding filename and line number all go together on the same line. It somehow posted the example jumbled when I listed it)
File1.txt Line 54
Job terminated unexpectedly
File1.txt Line 58 Process not completed
File1.txt
Line 101 User input not provided
File1.txt
Line 105 Process not completed
File2.txt
No errors found
File3.txt
Line 35 No tape media found
File3.txt
Line 156 Bad surface media
File3.txt Line 188
Process terminated
Those are just random fake examples for this post.
This allows me to perform analysis on a set of files for various projects I am doing. Later on, when the entire search is completed, I can go back to the results file and look and see what files had items I wish to follow up on. Therefore, the
line number that each match was found on will allow me to see the big picture of what was going on when the entry was logged.
I actually import the results file into a spreadsheet, where further information is stored regarding each individual text string I am using. Very useful.
If you know how I can successfully achieve this in one script, please share. I have seen plenty of posts out there where people have requested all different aspects of it, but I have yet to see it all put together in one and work successfully.
Thanks for helping.I'm sorry. I was so consumed in locating the issue that I completely overlooked posting what exactly I was needing help with. I did have one created, but I came across one that seemed more organized than what I originally created. Later
on I would learn that I had an error in log location on my original script and therefore thought it wasn't working properly. Now that I am thinking that I am pretty close to achieving what I want with this one, I am just going to stick with it.
However, I could still use help on it. I am not sure what I did not set correctly or perhaps overlooking as a typing error that my very last line of this throws an "Expected Statement" error. If I end with End, then it still gives same
results.
So to give credit where I located this:
http://vbscriptwmi.uw.hu/ch12lev1sec7.html
I then adjusted it for what I was doing.
What this does does is it searches thru log files in a directory you specify when prompted. It looks for words that are contained in another file; objFile2, and outputs the results of all matching words in each of those log files to another file: errors.log
Once all files are scanned to the end, the objects are closed and then a message is echoed letting you know (whether there errors found or not), so you know the script has been completed.
What I had hoped to achieve was an output to the errors.log (when matches were found) the file name, the line number that match was located on in that file and what was the actual string text (not the whole line) that matched. That way, I can go directly
to each instance for particular events if further analysis is needed later on.
So I could use help on what statement should I be closing this with. What event, events or error did I overlook that I keep getting prompted for that. Any help would be appreciated.
Option Explicit
'Prompt user for the log file they want to search
Dim varLogPath
varLogPath = InputBox("Enter the complete path of the logs folder.")
'Create filesystem object
Dim oFSO
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
'Creates the output file that will contain errors found during search
Dim oTSOut
Set oTSOut = oFSO.CreateTextFile("c:\Scripts\errors.log")
'Loop through each file in the folder
Dim oFile, varFoundNone
VarFoundNone = True
For Each oFile In oFSO.GetFolder(varLogPath).Files
'Verifies files scanned are log files
If LCase(Right(oFile.Name,3)) = "log" Then
'Open the log file
Dim oTS
oTS = oFSO.OpenTextFile(oFile.Path)
'Sets the file log that contains error list to look for
Dim oFile2
Set oFile2 = oFSO.OpenTextFile("c:\Scripts\livescan\lserrors.txt", ForReading)
'Begin reading each line of the textstream
Dim varLine
Do Until oTS.AtEndOfStream
varLine = oTS.ReadLine
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
Dim colMatches, strName, strText
Do Until oErrors.AtEndOfStream
strName = oFile2.ReadLine
objRegEx.Pattern = ".{0,}" & strName & ".{0,}\n"
Set colMatches = objRegEx.Execute(varLine)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strText = strText & strMatch.Value
WScript.Echo "Errors found."
oTSOut.WriteLine oFile.Name, varLine.Line, varLine
VarFoundNone = False
Next
End If
Loop
oTS.Close
oFile2.Close
oTSOut.Close
Exit Do
If VarFoundNone = True Then
WScript.Echo "No errors found."
Else
WScript.Echo "Errors found. Check logfile for more info."
End If
End if -
How to publish to an FTB server in iWeb 2 using the File ➙ Publish to Folder option??
I was just given the following advice regarding publishing to an FTP other than MobileMe.
Web 08 does not have that feature (drop down menu to publish from "site" icon). You will need to upgrade to iWeb 3 in iLife 11 in order to get that feature. You can get iLife 11 at the online Apple Store while supplies last since iWeb (and iDVD) have been discontinued by Apple
To pubish to an FTB server in iWeb 2 use the File ➙ Publish to Folder menu option and then use a 3rd party FTP client like Cyberduck to upload the site files.
Follon-on question, can anyone provide more details on how to do exactly what was suggested? I toyed with it and can only get it to publish to a folder on my desktop, but not to an external FTP. (I have already purchased a web-host package, just need to publish to it!)Okay. When you publish your site from iWeb to a local folder what you will get is one site folder - this site folder will have the same name as you gave your site in iWeb and one separate index.html file.
Your site folder contains an index.html file as well as the separate index.html file. You NEED both.
What you need to do is firstly using Cyberduck or whatever, upload your site folder to your host into whatever folder you need to upload to on the server - could be 'public_html', 'htdocs' or whatever - this is your root folder.
You then need to upload your separate index.html file to your server too, but this index file needs to sit outside your site folder because it needs to point in towards the index.html file that is in your site folder - this is the first page of your site.
You don't delete or duplicate any index files - iWeb produces the two index files that you need when you publish to a local folder - one index file in the site folder itself and one separate index file that sits outside the site folder and points into the first page of your site.
Also, remember to call the first page of your site something like Home or Welcome, but DO NOT name it index.
By the looks of things here you have not uploaded your index files correctly.
What I would suggest that you do is start over - so open Cyberduck and connect to your server and go and delete your site folder and your other index file if it is still there.
Go back to iWeb and publish to a local folder again and notice that you have both your site folder and separate index.html file.
Now go and open Cyberduck again and connect to your server and note where you need to upload your files to.
Now go and upload your Site Folder to your server and once this has finished go back and upload your separate index.html file, but this needs to sit outside your site folder. If you do this, then your site should display okay - as long as your other index file is pointing into to the first page of your site it should display correctly. -
Error while displaying file " C:Temp Filename.Ext cannot be created"
Dear Friends
Some users face problem while display the file. They get message " C:\Temp\ Filename.Ext cannot be created ". I checked Details. I got explaination as follows.
Caution! You are not authorized to work with temporary storage
Message no. ED204
Diagnosis
You do not have authorization to read or write from or to the temporary storage.
The system uses the temporary storage when you display or change programs using the ABAP Editor.
The system checks to see whether there is a temporary version of the program.
If there is, a dialog box appears in which you must choose whether to use the temporary version or the database version.
The system fills the temporary storage when the editor crashes or you save a temporary version of the program.
System Response
You probably do not have the authorization object S_DATASET.
Procedure
Ask your system administrator to assign you the relevant authorization.*
Actually this problem never occurs frequently. User access the files very frequently creating around 200 Mb to 400 Mb in C:\Temp Folder per day per user. I observerd as per message that User is not have Access right to C drive. Once I get access from IT for that user he is able to display file. But before giving right he is able to display file. But suddenly he is not able to display. I am not getting exact reason why this problem occurs. Some users temp folder size is upto 700 Mb with no acces right to C Drive still he is able to see the image.
In DC20 I have kept C:\Temp as path for temp folder.
I have checked the links also
Request you to provide me
What is exact reason of the error?
Is the solution to problem is giving access rights to the user?
Do I have to give authorization object S_DATASET to a user?
With Regards
Mangesh PandeDear Amaresh
Thanks for your reply and solution.
So you mean to say thats this Authorization object has to be provided to user?
But my question is how the user was able to see the file even when this Authorization Object was not assigned.
He was able to display all file. But for particular DIR he is not able to display.
I have checked this thread
http://wiki.sdn.sap.com/wiki/display/PLM/Error26172withSAPGUI710+patch13.
User has SAP GUI 7.10
File Version 7100.1.0.1027
Build 0
Patch Level 0
Request your help
With Warm Regards
Mangesh Pande -
Newbie: How to manage the number of files in a folder
I have a backup application that runs each day and creates a file in a folder.
I have an iCal scipt which automates this backup to run at a specific time but I would like to modify it so that it deletes the oldest file in the folder. I cannot figure out the best way to do this. Does anyone have any suggestions?This rather long script finds the oldest file in the complete nested range of a chosen outer folder and deletes it.
property filePathList : {}
property fileDateList : {}
getEveryFileName((choose folder) as alias)
Sort_items(fileDateList, filePathList)
set oldest to item 1 of filePathList
tell application "Finder" to delete oldest
to getEveryFileName(theFolder)
tell application "Finder"
my getNamesDates(get files of theFolder)
set FolderList to folders of theFolder
repeat with everyFolder in FolderList
my getEveryFileName(everyFolder)
end repeat
end tell
end getEveryFileName
to getNamesDates(FileList)
repeat with everyFile in FileList
try
tell application "Finder"
set end of fileDateList to modification date of everyFile
set end of filePathList to everyFile as alias
end tell
on error anError
display dialog anError
end try
end repeat
end getNamesDates
to Sort_items(sortList, SecondList)
-- sorts by the first list (dates), while keeping the second list in the same order.
tell (count sortList) to repeat with i from (it - 1) to 1 by -1
set s to sortList's item i
set r to SecondList's item i
repeat with i from (i + 1) to it
tell sortList's item i to if s > it then
set sortList's item (i - 1) to it
set SecondList's item (i - 1) to SecondList's item i
else
set sortList's item (i - 1) to s
set SecondList's item (i - 1) to r
exit repeat
end if
end repeat
if it is i and s > sortList's end then
set sortList's item it to s
set SecondList's item it to r
end if
end repeat
end Sort_items
dual-core G5/2.3 Mac OS X (10.4.6) dual screens -
Finder shows some but not all files in a folder
In some circumstances, Finder only shows some (but not all) of the files in a folder. Why?
I notice this with Excel autosave files in the Office 2011 Autorecovery folder (Macintosh HD ▸ Users ▸ Conor ▸ Library ▸ Application Support ▸ Microsoft ▸ Office ▸ Office 2011 AutoRecovery). In my case, Finder shows 34 files but "ls" in a Terminal window reports 40 files. The missing files do not start with a period (.) and have the same permissions as other files that show in Finder (-rw-r--r--@ 1 <myname> staff). Here's the last four lines of "ls -al" - the first two appear in Finder, but not the last two:
-rw-r--r--@ 1 myname staff 55296 8 Oct 2013 Word Work File D_1239425731.tmp
-rw-r--r--@ 1 myname staff 55296 8 Oct 2013 Word Work File D_1240072173.tmp
-rw-r--r--@ 1 myname staff 52796 13 Feb 11:08 safe1.xlk
-rw-r--r--@ 1 myname staff 95320 12 Mar 16:06 safe2.xlk
I have tried copying files from this folder to another folder, and/or changing their names. They still do not appear in Finder, nor are they visible in the File Open dialog of applications, even when the dialog is listing other files in that directory - but if I manually type the name into the File Open dialog, the app manages to find and open the file.
If I Spotlight-search for the file name, or search in Finder, without specifying that specific directory ("This Mac"), the file is not found, but if I direct the Finder search at that particular directory, then the search returns the relevant files.
So: why does Finder hide certain files when showing a folder, even though it can find and show those files if you specifically ask for them?
Now using OSX 10.10 (Yosemite), but I'm pretty sure I noticed this on OSX 10.8 as well.So simple - thanks. I'd not been aware of the hidden flag, and now I've found the -O option on ls to display it.
Follow-on question: I now see that you can change the system-wide defaults to display hidden files with this...
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
...but is there a way to specify this on a per folder basis? I'm happy enough to hide hidden files in general, but it would be nice if I could set an attribute/flag/whatever on the Office AutoRecovery directory that told Finder "in this folder, always display hidden files". Can I do this? -
How to count files in a folder and subfolders of the folder.
Hello everyone,
I'm having a difficulty with countin files in a Regular folder and subfolders of the folder. I've tried to use SI_ANCESTOR in a query; however, it gives me innacurate results.
I used this hierarchy to create the code below, and it works to count all the files:
Folder A ---> Folder B( subFolder of A) -
> Folder C(subFolder of B)
//get folder A
IInfoObjects regFolders = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND='Folder' AND SI_PARENTID=0 AND SI_NAME!='User Folders' Order by SI_NAME");
IFolder regFolder = (IFolder) regFolders.get(0);
//get files from Folder A
IInfoObjects rFiles = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID ! = 'CrystalEnterprise.Folder' AND SI_PARENTID=" + regFolder.getID() );
ilesCount += rFiles.size();
int subCntr=0;
nt subCntr2=0;
//get folder B
IInfoObjects rSubFolders = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Folder' AND SI_PARENTID=" + regFolder.getID() );
//get files from subFolders of Folder A
while (subCntr < rSubFolders.size())
IInfoObject subFolder=(IInfoObject)rSubFolders.get(subCntr);
IInfoObjects subFiles = infoStore.query ("SELECT * FROM CI_INFOOBJECTS "
+ " WHERE SI_PROGID != 'CrystalEnterprise.Folder'" AND SI_PARENTID=" + subFolder.getID() );
filesCount += subFiles.size();
//get subFolders of Folder B
IInfoObjects rSubFolders2 = infoStore.query ("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Folder' AND SI_PARENTID=" + subFolder.getID() );
//get files from subFolders of Folder B
while (subCntr2 < rSubFolders2.size())
IInfoObject subFolder2=(IInfoObject)rSubFolders2.get(subCntr2);
IInfoObjects subFiles2 = infoStore.query ("SELECT * FROM CI_INFOOBJECTS "
+ " WHERE SI_PROGID != 'CrystalEnterprise.Folder' AND SI_PARENTID=" + subFolder2.getID() );
filesCount += subFiles2.size();
subCntr2++;
subCntr++;
As you can see, the code is too complicated, and what if folder C has subFolder?
I'm guessin maybe recursion would be one way to got, but I'm not really good with it, so I was wondering if anyone has any idea on how to go about doing it.
Thank you,Hi,
For detailed information, please refer to the BI 4.0 developers guide here.
You can find the section "Setting up the development environment" in developers guide that have every single instruction to execute a java code specific to BI 4.0 environment.
Also, here are the instructions for BO 3.1 environment:
To configure a WAR file for a J2EE application that uses the BusinessObjects Enterprise XI 3.0 and 3.1 Java SDK, complete these steps:
Create a lib folder in the WAR file's WEB-INF folder.
Copy the Enterprise XI 3.0 or 3.1 Java SDK JAR files from the appropriate location below to the WAR file's WEB-INF\lib folder:
Windows:
...\Program Files\Business Objects\common\4.0\java\lib
UNIX:
<businessobjects_root>/java/lib
Copy the log4j.jar file from the appropriate location below to the WAR file's WEB-INF\lib folder:
Windows:
...\Program Files\Business Objects\common\4.0\java\lib\external
UNIX:
<businessobjects_root>/java/lib/external
Copy the entire crystalreportviewers12 folder from the appropriate location below to the WAR file's root folder.
Windows:
...\Program Files\Business Objects\common\4.0
UNIX:
<businessobjects_root>/enterprise12/JavaSDK
Open the web.xml file located in the WAR file's WEB-INF folder.
Specify the location of the utility files used by the report viewers contained in the crystalreportviewers12 folder by inserting the following code below the <display-name> and <description> tags but within the <webapp> tag definition:
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>/BOXIR3/crystalreportviewers12</param-value>
</context-param>
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
Deploy the WAR file to the J2EE application server.
You are now able to run an application using the BusinessObjects Enterprise XI 3.0 and 3.1 Java SDK on a J2EE web application server.
Hope it helps.
Regards,
Anchal -
(every document file of every folder in folder thePath) as alias list
On Dec 9, 2006, at 1:03 AM, Bill Hernandez wrote:
I use "set aList to get every file of every folder in startFolder" the references are to "document file path2file" instead of "alias to path2file", and I was not successful getting BBEdit to work with them without generating errors
On Dec 9, 2006, at 9:25 AM, Jim Correia wrote:
The open event requires a list of file references (aliases). This is true of all scriptable applications, not just BBEdit.
Normally you can coerce Finder object references to aliases. In this case a bug in the Finder is getting in your way.
set aList to get every file of every folder in startFolder
This is returning invalid object references - ones not even the Finder can resolve at a later date.
It seems to drop one level of hierarchy when building the object specifiers in response to that whose clause. You can avoid the Finder bug by using some alternate means of building up the file list.
Jim
Here's what I came up with, and it solved my problem...
-- ---------+---------+---------+---------+---------+---------
on script_title()
Filename : getevery_file_ofevery.scpt (Script Debugger)
Author : Bill Hernandez
Version : 1.0.0
Updated : Tuesday, January 02, 2007 ( 6:15 PM )
end script_title
-- ---------+---------+---------+---------+---------+---------
on script_notes( )
This is a work around to the alias list problem I encountered
end script_notes
-- ---------+---------+---------+---------+---------+---------
tell application "Finder"
activate
set thePath to choose folder
-- THIS DOES NOT GIVE THE CORRECT ANSWER --> instead of an alias list, it returns a document list
set aSel to (((every document file in folder thePath) & (every document file of every folder in folder thePath)) as alias list)
display dialog ("[2451] " & (get modification date of (item 1 of aSel)) as string)
set f_info to info for (alias ((item 1 of aSel) as text))
display dialog ("[2452] " & (get modification date of f_info) as string)
-- THIS DOES THE TRICK, it returns an alias list
set aSelection1 to (every document file in folder thePath) as alias list
set aSelection2 to ((every document file of every folder in folder thePath)) as alias list
set aSelection to (aSelection1 & aSelection2)
display dialog ("[2453] " & (get modification date of (item 1 of aSelection)) as string)
set f_info to info for (alias ((item 1 of aSelection) as text))
display dialog ("[2454] " & (get modification date of f_info) as string)
end tell
-- ---------+---------+---------+---------+---------+---------Hi Bill,
That's not really a bug. In this line:
set aSel to (((every document file in folder thePath) & (every document file of every folder in folder thePath)) as alias list)
two list are being concatenated which returns a list and 'as alias list' doesn't work on lists. You could do this:
set aSel to (every document file in folder thePath as alias list) & (every document file of every folder in folder thePath as alias list)
If there aren't anymore levels, then you can use 'entire contents':
every document file of entire contents of folder thePath as alias list
Note that if only one file is returned, then it will error because of automatic coercion, so it's better to do it your way if you don't know how many files there are. Then, you would use an error handler to trap the error. Here's what I've been using:
try
set aSel1 to (every document file in folder thePath as alias list)
on error from o
set aSel1 to o as list
end try
try
set aSel2 to (every document file of every folder in folder thePath as alias list)
on error from o
set aSel2 to o as list
end try
set aSel to aSel1 & aSel2
There is another way to coerce finder references to something usable in other applications that can't deal with Finder references. You can coerce Finder references to strings using text item delimiters.
gl, -
Viewing html files in a folder...
Hi...
Anyone know how to view html files in a folder(s). What i mean is have them display as thumbnails, etc, so one can identify them visually rather than just by name? Abit like Bridge displays image files and even .psd and .ai files....
Cheers,
JJmartcol wrote:
I was interested in this and had a Google around. It struck me that you can get stand alone file viewers and I thought there must be one for HTML? I came accross this: http://www.anixsoft.com/htmlview.html
Absolutely no idea what it might be like but I'm willing to give it a try at the weekend. Maybe there are others out there?
Martin
Googled too... but found nothing interesting... except what seems an old hack from a Microsoft guy who had a registry fix. But the link was very old...
Anyway, have downloaded the link you gave... thanks... it seems to work as a standalone... almost like an image viewer such as irfan or Xnview...
Cheers,
JJ -
Script doesn't take all the files in the folder
I have compiled a script from different resources. It pads images to specified dimensions. But I can't get it to process all the images in a folder. It only does one.
Here is the script.
(* IMPORTANT: The with pad color parameter of the pad command does not work in Mac OS 10.5.5. Use4 the SIPS command-line utility instead when padding with a color *)
set this_folder to (choose folder with prompt "Pick the folder containing the files to process:") as string
tell application "System Events"
set these_files to every file of folder this_folder
end tell
repeat with i from 1 to the count of these_files
set this_file to (item i of these_files as alias)
set this_info to info for this_file
end repeat
property target_dimensions : "1024, 768"
property default_color : {0, 0, 0}
set this_path to the quoted form of the POSIX path of this_file
-- get the final dimensions for the padded image
repeat
display dialog "Enter the target dimensions for the padded image:" & return & return & "target width, target height" default answer target_dimensions buttons {"Cancel", "Set Color", "Continue"} default button 3
copy the result to {text returned:dimensions_string, button returned:button_pressed}
if the button_pressed is "Set Color" then
set the default_color to choose color default color default_color
else
try
if the dimensions_string does not contain "," then error
set AppleScript's text item delimiters to ","
copy every text item of the dimensions_string to {width_string, height_string}
set AppleScript's text item delimiters to ""
set target_W to width_string as integer
set target_H to height_string as integer
if target_W is less than 1 then error
if target_H is less than 1 then error
set the target_dimensions to (target_W & ", " & target_H) as string
exit repeat
on error
beep
end try
end if
end repeat
set the hex_color to text 2 thru -1 of (my RBG_to_HTML(default_color))
try
tell application "Image Events"
-- start the Image Events application
launch
-- open the image file
set this_image to open this_file
-- get dimensions of the image
copy dimensions of this_image to {W, H}
-- calculate scaling
if target_W is greater than target_H then
if W is greater than H then
set the scale_length to (W * target_H) / H
set the scale_length to round scale_length rounding as taught in school
else
set the scale_length to target_H
end if
else if target_H is greater than target_W then
if H is greater than W then
set the scale_length to (H * target_W) / W
set the scale_length to round scale_length rounding as taught in school
else
set the scale_length to target_W
end if
else -- square pad area
set the scale_length to target_H
end if
-- perform action
scale this_image to size scale_length
(* The with pad color parameter is broken in Mac OS X 10.5.5
-- perform action
pad this_image to dimensions {target_W, target_H} with pad color default_color
-- save the changes
save this_image with icon
-- purge the open image data
close this_image
end tell
-- The with pad color parameter is not working in 10.5.5 so use the SIPS command-line utitlity instead
do shell script "sips " & this_path & " -p " & target_H & space & target_W & space & "--padColor " & hex_color & space & "-i"
on error error_message
display dialog error_message buttons {"Cancel"} default button 1
end try
on RBG_to_HTML(RGB_values)
-- NOTE: this sub-routine expects the RBG values to be from 0 to 65535
set the hex_list to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
set the the hex_value to ""
repeat with i from 1 to the count of the RGB_values
set this_value to (item i of the RGB_values) div 256
if this_value is 256 then set this_value to 255
set x to item ((this_value div 16) + 1) of the hex_list
set y to item (((this_value / 16 mod 1) * 16) + 1) of the hex_list
set the hex_value to (the hex_value & x & y) as string
end repeat
return ("#" & the hex_value) as string
end RBG_to_HTMLThe problem is this repeat loop
repeat with i from 1 to the count of these_files
set this_file to (item i of these_files as alias)
set this_info to info for this_file
end repeat
It goes through every file in the folder but only sets the variable this_file to one file. When the loop is finished this_file is only pointing to one file, which is the file that will be processed.
A few ways to handle this, the easiest is to move the
end repeat
at line 5 to the just after the do shell script at line 81.
Maybe you are looking for
-
Edit Margins in Crystal Reports 2008
Hi I am very new to Crystal Reports and don't really know anything about it. I have to amend an existing project and it requires me to change the page margins. The only way I know of to change the margins are by using Page Setup. This works great and
-
So I Am In Theater , And I Just Got The Movie They Made Of The Show, I Wanted To Put It Onto My iPod Is There Anyway How?
-
Can a client be refreshed with client copy?
I created a new client by doing client copy from client 200 creating client 202 Now I want to refresh client 202 from client 200 (ALL ON SAME SERVER) , can I just re-run the client copy with source client being client 200 to client 202? If so what am
-
:: CALIBRATOR ASSISTANT WON'T LET ME CALIBRATE MY MONITOR ::
I'm hoping someone can help me with this problem. I have been trying to calibrate my monitor for a few weeks now and the calibrator assistant is NOT letting me. When I go through all of the steps it tells me, "Conclusion. An error has occured. The ne
-
Help with Social buttons ...
Hi, I'm designing a muse site with social buttons that are created when you embed code from a site such as facebook, and others. They look like this on my site ... I would like to build a 'social' area on my site that looks like this instead ... So,