VB6, ActiveReports, and CanGrow property - vb6

I've got an ActiveReport which has a textbox populated at run time. The "cangrow" and "multiline" properties are both set to "true".
When I run the report on my machine, the report prints out fine with all of the text set at run time. IE: "Dear John, hello -- how are you..." There's only about 250 characters for this textbox.
However, one of the machines downstairs will only print the name of the textbox. IE: "txtVerbage". A blank report with "txtVerbage" in the middle of it, where the body (see above) should be.
Has anyone else had this experience? I've been banging my head against the wall for days now.
Thanks,
Jason

Its probably the timing of when you're setting the Field/TextBox value. Make sure you set it in the Format event of the section containing the control (e.g. Detail_Format). Using the BeforePrint or AfterPrint or one of the Report events can yield unpredictable results like this.
Also be sure you set the Field.DataValue property and not the Text property.
Some background information on this is in the articles below:
ActiveReports Architecture: Report Processing
ActiveReports Architecture: Events
Navigable documentation w/ TOC
Hope this helps!
Scott Willeke
GrapeCity

The data you access from downstairs is not there. That is why when you bind the data to the report, nothing appears. The reason you see txtVerbage is because that is what you called the text control and that was the default text there.
So you need to make sure that you are actually getting data.

Related

UFT is waiting the entire object sync timeout before clicking a webelement

Alright, in my web application there's a dropdown that UFT picks up as a 'WebElement' instead of a 'WebList'. The options available in this dropdown are all just 'divs' and the data within the div is dynamic. Has anyone had to deal with this before? I even tried using the absolute xpath within the object repository, but that seems to be inconsistent. Whenever I run my test the first time it interacts with the dropdown it will wait the entire object sync timeout before selecting the element. Then I have it going back to select another item from the dropdown and it goes instantly. This isn't the approach I want to take with this as the abs xpath could break at any time. I've been reading blog posts etc from as far back as 2008, and tried every person's suggestion but I can't reliably click a dropdown and select something. I can give more detail if needed, but any help here would be appreciated.
When UFT waits the object synchronization timeout and then succeeds to perform the action it's usually because it has been using smart identification. Look in the report to see if this is the case (or just disable smart identification and see what happens).
If this is the case, you should try to fine-tune the description to succeed on the description and not resort to smart identification.
I got it! This behaviour was being caused by the 'browser' being different in that part of my code. I think this happened due to some of the same items being added into the OR from different pages.
Instead of having:
Browser("Browser1").Page("Page1").WebElement("Element I want").
It was:
Browser("Browser2").Page("Page1").WebElement("Element I want").
Once this was corrected in the OR everything worked as expected.

rdlc-repeat data in report header across multiple pages

I am using ssrs 2012.
How can I repeat username in the report header? ReportItem doesn't work if the report spans across more than one page.
I was told to use Internal parameters but there is no such option with rdlc.
Can this somehow be done in codebehind?
Thanks
I am a bit confusing about your problem.
Just add a page header, rigth click on report design surface, insert->page header:
Add a text box and set the expression value to the following built-in field
You should get something like this in every page:
Note I am using rdl but built-in fields is available for both RDL and RDLC.
Let me know if this was helpful.

Knockout set initial value of an input field where html is allowed

I have two input fields first name and last name.
Application was running really well.
Suddenly someone came in from Mars and input something like this in those input fields
*(~'##~>?<+!""*%$)!
for both first name and last name. Now don't ask me why he did this cause in Mars this is very common. You can try it on this fiddle
http://jsfiddle.net/farrukhsubhani/3RjRF/
This text then went into my database and now when i retrieve it it came back like this
*(~'##~>?<+!""*%$)
which is ok for me as its html and I can place it back into knockout and it gets populated as html as you can see in fiddle above. However this Mars guy then thought that on Earth this is not a nice name to be with so he tried to edit field.
The above fiddle is kind of that edit page which shows him old value at bottom and two fields at top. He does not know html so he thought we have changed his name in input fields however I need to know
When passing text to knockout to give initial value to an input field is it possible to tell it that consider this text as html so it renders properly in input field
The other way around is to send him to http://www.w3schools.com/tags/ref_entities.asp and tell him about reserved HTML characters. This info has been stored in database (using Entity Framework simple person.fname and person.lname both with attribute AllowHTML) so on my fiddle i have just placed it in two variables and you can see how actual text boxes are different than html below. If i dont bind using Knockout then actual text is shown in these boxes and user can edit <>' signs without any problem.
Anyone with a solution before he leaves our planet. This can change alien life on our planet.
Update
If i go into this field and paste (~'##~>?<+!""*%$)" binding works fine and you can copy this and paste it into fiddle to see that. However its not taking that value from Javascript variable to knockout expects it to be a string and html special characters are not shown properly in input field.
We have done another test without Knockout and this text does get rendered within the field when you try to edit it its fine.
We have updated JSfiddle to work without JQuery and its the same result if you store it in a js variable and give not value to input field
http://jsfiddle.net/farrukhsubhani/3RjRF/3/
If we assign value to input field and just use jQuery to populate fullname then it works
http://jsfiddle.net/farrukhsubhani/3RjRF/4/
This last fiddle is a working example and we want Knockout to do what JQuery is doing.
I think the question then comes to how can this text be stored in javascript variable and placed into input field as html text so special characters appear unescaped. You can try unescape on jsfiddle that did not work for us.
Somewhere along the trip into (or maybe out of) your database, the value is being HTML-escaped. It's not Knockout itself that's doing it. You're going to need to track that location down, but you can't just disable it; you're going to have to replace it with something that sanitizes the result or otherwise you're opening yourself up to cross-site scripting attacks (any <script>s from external sources inserted into the input would have complete access to your data).
Any time you see the html: binding used, warning bells should go off in your head and you should VERY carefully to check to ensure that there's NO possibility of raw, unexamined user input making it into the string that gets displayed.
Ok here is what i did at the end
http://jsfiddle.net/farrukhsubhani/3RjRF/7/
I have done following:
I have added value attribute to input field and placed the input text as it came from server into it. Because I am using TextBoxFor in MVC it did that for me.
Before I apply knockout binding I have picked this value up using $('#kfname') and passed it to the actual binding so it used the value that came from server. Previously it was passed like (#Model.fname,#Model.lname)
I think what this did was allowed jQuery to pick up the value and assign it to binding instead of variable
ko.applyBindings(new ViewModel($("#kfname").val(), $("#klname").val()));
Hopefully this would help someone using knockout.

Why is the 'time ago' not displayed in my view?

I'm not sure whether this is a bug or not, so I'm just going to ask this. I created a view (and block) with a 'Comment: Post date' field with 'Time ago (with "ago" appended)' as Date format. I didn't fill in a custom date format.
Everything is previewed perfectly, but when I go to my dashboard, I only see the "ago": the actual numbers (hours, minutes, seconds...) aren't displayed.
I cleared caches, but nothing happened. I'm still using the default Seven 7.23 administration theme for my dashboard and I didn't set a custom template file or anything else. I just created the view.
How can I solve this?
Edit: I exported my view, so you can read the code here.
Try clearing your cache in drupal. Admin > Configuration > Performance > Clear All Caches
(/admin/config/development/performance)
I noticed you said you added Comment: Post Date. If you did not mean to display the time of comments on the node then my guess is that would be your issue. If not comments exist, you have nothing to get the last time.
If you wanted to get the last time of the save for the node then you will need to switch to last updated to fix your issue.
Edit: It seems odd to me that everything is working in the views preview section but not on the actual page. This leads me to think it might have something to do with the user you are viewing it with. Are you logged in when you test it, or are you opening it in a different browser on a new session? Check the user permissions for your content field type and make sure "can view" is checked.
I don't know what causes the problem, but I solved it temporally. I changed the Date format to 'Time ago' an added the 'ago' manually via the 'Rewrite results' function.

Show error messages on top of form ? Or beside each individual fields?

Which approach do you all think is better?
Next to each field, highlighting each field in a distinctive color or with an easily distinguishable mark, so it's self evident where the problems are, especially on a long form. Also place a help icon next to each failure providing more information in case it's needed by some users. In addition, do not forget to preserve the data that's correct in between failures.
I put a summary of the errors at the top of the form that gives details as to why a field value is incorrect such as "Field1 is Required and must be an integer". I also add visual indicators on the field that errored, typically an asterisk next to the field or changing the color of the input area.
It will always depend on the situation, but...
I prefer to do a non-obtrusive indicator (* perhaps) beside each field and show more detailed messages or a summary message at the top (or bottom) of the form with longer forms.
If the form is shorter, you can probably get away without providing a "summary". I changed my mind on this, you should probably provide a summary.
Identifying the field with an error is important, definitely. However, a summary at the top letting the user know that there are errors below can be helpful for a long form. Additionally, you can put more details in the top summary section that you might not have room for below.
We supply a small indicator next to each field with an error. When you roll over the indicator a tool tip gives you what needs to be fixed. We then also give a summary at the smae time so they can see all of the errors they need to fix.

Resources