Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Assign a dynamic value to a report

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Assign a dynamic value to a report

    I have a report that works perfectly in the desktop environment where I assign a dynamic value to an image field obtained from a UDF. When I run the report on the desktop the correct image is displayed. Now, when I publish the report and run it under WAS the report does not seem to be able to find the UDF and run the function to obtain the image name. I've verified this by adding a calculated field on the report that just shows the name of the image obtained from the function. On the desktop the correct name shows but when running on the WAS the field does not get a name. I'm including the compiled AEX file when I publish so I'd hoped my report would then be able to see the global function.

    There must be a way to do this otherwise reports would be extremely limited when running through the web interface. Any suggestions? I know that to call UDFs from a grid you have to reference the Xbasic library (which I call PVA which matches the name of my web project) but I don't see anything under reports to create the same type of reference.
    Brad Weaver, President
    ComputerAid International
    Ottawa ON Canada
    Versailles KY USA
    www.compuaid.com

    #2
    Re: Assign a dynamic value to a report

    Is there any way to use the dynamic fields in a report that's running from the web server to reference a session variable or call a function? I suppose if I can't call an Xbasic function from the report I could set a session variable in the button that calls the report beforehand and establish the filename for the image field assuming the image field would then be able to dynamically use the session variable. This one has me totally stumped!
    Brad Weaver, President
    ComputerAid International
    Ottawa ON Canada
    Versailles KY USA
    www.compuaid.com

    Comment


      #3
      Re: Assign a dynamic value to a report

      Okay I seem to have solved this one. I had a couple of issues. The first was that I had forgotten to clear the AEX cache on the WAS server after publishing. The second was that while I have to use relative paths to images within a list control on a UX component apparently the report engine that builds the report prior to sending it through the WAS wants the actual physical path to the image directory so I had to modify my UDF to return the correct path. Once I did both of these things I was able to simply insert the UDF name and parameters in the Dynamic property of the Image component on the report and voila the right photos started showing up when running on the WAS.
      Brad Weaver, President
      ComputerAid International
      Ottawa ON Canada
      Versailles KY USA
      www.compuaid.com

      Comment


        #4
        Re: Assign a dynamic value to a report

        Further follow up with Selwyn provided another option. If you use Layout Tables or convert your freeform table to a layout table then you can simply embed a calculated field that contains the HTML markup for an <img src> tag that points to your photo. One caveat is that the function I call has to determine whether you are running on the desktop or from a browser via WAS and adjust the src file for the image tag with the correct path. It should be a file://fullpathname/filename.jpg for the desktop and a relative path imagepath/filename.jpg for running under WAS.

        Selwyn produced a short video to demonstrate this:
        http://screencast.com/t/NzLKRfql

        The sample on the video only works for the desktop. To get it working under WAS I create a logical variable IsDeskTop in my Autoexec script and set it to true and then I call the following function from my calculated variable:

        Code:
        'Date Created: 23-Jul-2013 09:08:06 PM
        'Last Updated: 24-Jul-2013 07:47:31 AM
        'Created By  : Brad
        'Updated By  : Brad
        FUNCTION GetPhoto AS C (ID AS N )
        
        	Dim fn as c
        	Dim wn as c 'Relative path web name used for WAS
        	Dim desktop as L 'Flag to determine if running in desktop or WAS
        	Dim pathroot as c 'Holds the root path to the files based on desktop or WAS runtime
        	
        	desktop = eval_valid("IsDeskTop") 'This will only evaluate to true when running on the desktop
        	
        	if desktop then
        		' Use a5.Get_Name to get the name of the current database
        		fn = a5.Get_Name()
        		' Now parse out the path of the current database working directory
        		' and add \images\employeeid.jpg to the filename
        		pathroot = file.filename_parse(fn,"dp")+"images"
        		'fn = file.filename_parse(fn,"dp")+"images"+chr(92)+id+".jpg"
        	else
        		' Use the relative path off of the A5Webroot (or modify to the project web root if publishing to a project directory)
        		' To link off of web root or project web root to a physical directory elsewhere use the 
        		' mklink <project_directory_name> <physical directory path> /D command as Administrator to 
        		' create a symbolic link.  This gives WAS the equivalent of a virtual directory in IIS'
        		pathroot = "C:"+chr(92)+"A5Webroot"+chr(92)+"TestImages"
        		'fn = "C:"+chr(92)+"A5Webroot"+chr(92)+"TestImages"+chr(92)+id+".jpg"
        	end if
        
        	' Set fn to the full physical path and wn to the relative web path
        	' In this case we're assuming that the physical path is a subdirectory 
        	' "images" under the project directory and that the relative web path
        	' is a symbolic link to that directory located under the A5webroot.
        	fn = pathroot+chr(92)+id+".jpg"
        	wn = "TestImages/"+id+".jpg"
        	
        	' Check to see if the file exists and if not show the nophoto image
        	if file.exists(fn) = .f. then 	
        			fn = pathroot+chr(92)+"NoPhoto.jpg"
        			wn = "TestImages/NoPhoto.jpg"
        	end if
        	dim txt as c
        	
        	if file.exists(fn) then ' We found either the employee photo or the nophoto.jpg photo
        		if Desktop then
        			dim fn2 as c
        			' Convert backslashes to forward slashes for HTML
        			fn2 = stritran(fn,chr(92),"/") 
        			' Add the preamble file:// to use the physical path
        			fn2 = "file://" + fn2 
        			' Now create an HTML img src tag with the filename in fn2.
        			txt = "<img style=\"width: 200px; border: solid 1px blue;\" src=\""+fn2+"\" />"
        		else
        			' Otherwise just use the relative path since we're running in WAS
        			txt = "<img src=\""+wn+"\" style=\"width: 200px; border: solid 1px blue;\" />"
        		end if
        	else
        		txt = "Image not found - " + wn
        	end if
        	GetPhoto = txt
        END FUNCTION
        Brad Weaver, President
        ComputerAid International
        Ottawa ON Canada
        Versailles KY USA
        www.compuaid.com

        Comment

        Working...
        X