Crystal Reports conflicting with css .net - c#

the crystal reports i create from visual studio seem to be conflicting with the website format
This is how the menu should be
This is how it is coming with crystal reports loaded on the program
Any idea why its doing this?

The Crystal Reports viewer renders everything into a control that exists on the page. In order to make it look the way it does they needed to add a virtual directory that you can see referenced if you right click and 'view source' on your webpage.
When you do this, you'll see the supporting directory referenced countless times to access everything from JavaScript files to images and CSS. (aspnet_client\system_web\2_0_50727\crystalreportviewers13 is ONE example of the path you might see, depending on the version of Crystal Reports you are using).
My point here, is that the CSS referenced should fall under this path. The issue created on your site is likely due to an issue that arises from the way the CSS applies itself to the page. Unfortunately CSS, like JavaScript objects, can have conflicts with other elements on the page. They aren't "self contained" by nature.
A GREAT way to see the exact location of the CSS causing issues is to install the Web Developer add-on for FireFox or Internet Explorer. With this installed you can go to the 'CSS' menu and actually view the list of CSS files affecting the site. In fact, you can even disable CSS by location and see how it affects the page LIVE. You can also click on objects in the page and it'll expose details about the CSS applied to the objects. Alternatively or as well, you can install the FireBug add-on. It's got a great UI and can give you other tools for investigating it.
Good luck isolating the CSS. Once you've found it you'll need to either adjust your existing CSS to avoid it, use !Important tags to override their styles, or some combination of mark-up and CSS adjustments. I don't recommend adjusting the Crystal Report Viewer's CSS, it's safer and more maintainable to edit YOUR CSS to avoid the issue.

Related

Can Override Bootstrap CSS in ASP.NET MVC5 Application?

I am relatively new to using ASP.NET MVC5. It is nice that Bootstrap is built in but it seems to be very abrasive to altering the CSS based on the Site.css file.
My style sheet (Site.css) is in the Content folder in my solution.
Similar questions are out there but those are the answers I have tries (show below and obviously having the file AFTER the bootstrap...)
I have had some success using just the inline CSS and jQuery but I want to be able to use my style sheet.
It seemed that switching from relying on the bundle to this line...
#Styles.Render("~/Content/css")
for the reference was better fit... but it STILL doesn't consistently update to my styling.
so then after some digging through old questions I found this...
<link href="#Url.Content("/~Content/Site.css")" rel="stylesheet" type="text/css" />
and it seems like one in a while it works but NOT consistently...
I thought at first it had to do with the strongly types bootstrap file with the elements getting more specific styling points, but even when experimenting with the strongest id/elementname/nesting combinations I could it STILL wouldn't work. (i want to do hovers and such, but even easy things like changing the text color don't work)
Is there some giant flaw in this strategy?
Is there something I'm missing?
To the best of my knowledge this shouldn't be a huge problem, I would appreciate it greatly for someone to help me out or at least tell me why I'm sooooo wrong.
Thanks.
Although the solution provided by EdSF is good it is still not very understandable for someone who has just started with mvc5. So I will try to explain it a little bit more.
Go to
/App_Start/BundleConfig.cs
this is the file where all your stylesheets are bundled.
bundles.Add(new StyleBundle("~/bundles/css").Include(
//"~/Content/css/bootstrap.min.css",
"~/Content/css/Site.css",
"~/Content/css/jquery-ui-1.10.4.min.css"));
comment out the line of bootstrap if you don't want to use it and add you css just like the above. But remember It will remove bootstrap completely and unless you have written you own bootstrap-ish stylesheet for responsive webpage design, you should keep it.
When your view page is rendered in the browser inspect the element that's design is not according to your stylesheet and check the class name on that element and override that class with your own stylesheet class and add !important tag on the style attribute so that it will not be overidden by anything else.
Try these steps. Good luck.
Just to make sure: there's nothing about ASP.Net/MVC etc that imposes anything about styles.
You can use Bootstrap or not, or any other styling framework
Bootstrap isn't "built in", it's just the default when an MVC application is scaffolded for you
That out of the way, you don't have to use Bootstrap if you don't want to.
/App_Start/BundleConfig.cs - this is where you define what CSS and javascript frameworks, files you want to be bundled with your application. Modify (add/remove/etc) it to your needs.
Other than that, overriding CSS classes is pretty much the same as it is anywhere (nothing is imposed by the ASP.net framework).
Hth
RESOLVED: what seemed to be the main issue was not clearing my cache between tests. Although this seems a little tedious, I was finally able to get some Styling in.
but there were 2 more things I tried (from other question on Stack-Overflow) which seemed to all combine to getting it working better. (though it would still be nice if changes consistently reloaded on refresh without restarting the app! (I run parallels so it takes quite a long time!)
ANYWAYS! The (3) changes I made that were most effective
Clearing the cache (so the browser is forced to re-render the script
Changing the name in the "Bundle_Config" from "site/css" to match "Site/css" (not positive why it is like this in the scaffold.. or if it matters...but it seemed to make communication with the file more consistent.
Adding another reference (THIS HELPED THE MOST) adding an additional stylesheet reference to the relative path aside from the built in "renderStyles" from the budleconfig that takes place in the _Layout.cshtml.
<link href="#Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
granted I still need to clear the cache once in a while and restart the app to see changes, I am at least able to change the styling...
thanks for the help everyone!

How to Apply Style Sheet to HTML Designer Only?

I am working on a Web application project and although I am an experienced Visual Studio developer almost all of that has been in WinForms, console apps, Services, etc. That is, I have very little experience with using VS to develop web pages (Web Forms, asp.net, etc.), however, I am learning how to apply my previous Web page knowledge to VS.
One thing that has been throwing me for a while is how to apply additional CSS files in development, that should not be used in production (because they are already there). Specifically, I am working on a set of pages (DNN module) that is being deployed into a larger website context.
This all works fine, except the VS Web Page Design Editor is nigh useless because it's WYSIWYG rendering is not even remotely close to what the page looks like on the site. I know why this is happening: the site (and DNN) have their own set of CSS files that are getting applied/added to the page.
I know that I could just add those same style sheets to my web page in development (using <link href=...> tags?), however, then the web page would be deployed referencing these CSS files twice (there's a bunch of them too).
So my question is, is there any easy solution to this? Is there some setting somewhere that I can just say "use these additional CSS files in development or in the Design Editor"? (I hHve tried to google this, etc. but I just find dozens/hundreds of articles about how to add or edit CSS in Visual Studio)
Unfortunately I think that may have mis-explained my need somewhat. The issue really is not a development vs production issues, but rather an IDE vs execution issue. When debugging the code or otherwise running it in development, it is still within the DNN test environment we have setup, so it does have the extra file even here.
This is really about the HTML designer, when i am using it it does not have these extra style sheets, so I cannot see what the work I am doing really looks like. Instead, i have to run it every time I want to see whether any change i make looks like it is supposed to. This gets extremely onerous, especially with how slow DNN is to compile and reload.
Hmm, do you have your web project setup to run on IIS instead of IIS Express?
Something I do is often just work in the project then Save and if needed build. Then browse to the Site on my machines IIS instance (right click file in solution explorer and select browse if using ASP.NET Web forms).
Once I have done that I can refresh my page. I also use #if Debug in my code to bypass user login and etc to make round tripping faster...

C# asp.net application, changes to Site.css do not seem to affect Site.Master

I just started an asp.net c# project and I was trying to change the text-align of the .title and background color of the .header. I add the required code to the style sheet, but nothing changes in the header of the form. I'm probably missing something simple here, can someone point me in the right direction?
Stylesheets are usually cached by the browser to speed up browsing.
You can either force-refresh (SHIFT+F5) or append a value to the stylesheet path to cache-bust it.
style.css?v1
By changing v1 whenever you want a change to be forced out to all browsers, it will replace the cached version as resources are cached per URI.
Just try stopping your Local development server and do clean and build solution before running the application.
Even clear your temporary internet folder which may contain stale copy of your css file.
Right clicking in the markup view , you should see an options that says view in browser. This should reload anything cached.

Ajax Template Editor for Reports

I have been tasked to create a layout editor for my companies internal Reporting System. The Specifications they gave me indicate that templates must be able to be defined in .html files in a certain folder. These HTML files can have their own style etc. So it's a full HTML page with the html, head and body tag with content areas that are indicated with special a syntax.
Now what's been bothering me is that I have to load this page with it's styling etc. into a layout div (or IFrame maybe?) where I need to be able to work on it with Javascript (Using JQuery) to insert the controls to manage how the data is displayed.
I can't seem to find a way to do this. Any ideas as to how achieve this according to specifications? Any Help will be appreciated.
The only way to load the page with all referenced stylesheets applied appropriately, and avoiding javascript conflicts is to embed the html in an iframe.
This does however mean that your page will have to be served from the same domain as your application in order for you to be able to interact with the content in an easy way, but as long as this is so (possibly using your app as a proxy for the pages) there is cross browser support out there from jQuery * other javascript frameworks are available I'm sure.

Home/Landing screen design for a website in asp.net

I have an web based application. The content for the Home page has been currently mentioned in the HTML code for the Home page using , and tags. To change the content anytime in future, it needs to be changed in the HTML code. :(
Is there a way that we can pick up the content from some external place and get it reflected through the website. This ways, any change if required can be made at the external location without referring to the application's code.
Please advise if there is any solution for it.
Thanks.
You can
Use a database
Include external files using Server Side Includes
Read external files and write their contents and an alternative method
Sounds like you're looking for a Content Management System (CMS), which will allow your content editors access to modify only specific blocks of a page that you specify.
There are a ton out there to do what you want, so you don't have to start from scratch. Just Google 'CMS'.
Although I haven't used it myself, DotNetNuke is a popular one these days and has a free version.

Categories

Resources